From a84060e8d10b05c42fb4b0145418d34f79e89d1f Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Mon, 24 Jul 2017 14:59:04 -0700 Subject: [PATCH] CamelCaseifcation of LED related functions s/led_set_crgb_at/setCrgbAt/ s/hsv_to_rgb/hsvToRgb/ s/led_get_crgb_at/getCrgbAt/ s/led_sync/syncLeds/ s/get_led_index/getLedIndex/ s/send_led_data/sendLedData/ s/led_power_fault/ledPowerFault/ --- src/BootAnimation.cpp | 8 ++++---- src/Kaleidoscope-LEDControl.cpp | 28 ++++++++++++++-------------- src/Kaleidoscope-LEDControl.h | 8 ++++---- src/LEDUtils.cpp | 4 ++-- src/LEDUtils.h | 2 +- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/BootAnimation.cpp b/src/BootAnimation.cpp index be4d9cd4..396d438e 100644 --- a/src/BootAnimation.cpp +++ b/src/BootAnimation.cpp @@ -4,11 +4,11 @@ #ifdef ARDUINO_AVR_MODEL01 static void type_letter(uint8_t letter) { - LEDControl.led_set_crgb_at(letter, {255, 0, 0}); - LEDControl.led_sync(); + LEDControl.setCrgbAt(letter, {255, 0, 0}); + LEDControl.syncLeds(); delay(250); - LEDControl.led_set_crgb_at(letter, {0, 0, 0}); - LEDControl.led_sync(); + LEDControl.setCrgbAt(letter, {0, 0, 0}); + LEDControl.syncLeds(); delay(10); } #endif diff --git a/src/Kaleidoscope-LEDControl.cpp b/src/Kaleidoscope-LEDControl.cpp index fd483ea0..c0c1e2ce 100644 --- a/src/Kaleidoscope-LEDControl.cpp +++ b/src/Kaleidoscope-LEDControl.cpp @@ -100,28 +100,28 @@ LEDControl_::set_all_leds_to(uint8_t r, uint8_t g, uint8_t b) { void LEDControl_::set_all_leds_to(cRGB color) { for (uint8_t i = 0; i < LED_COUNT; i++) { - led_set_crgb_at(i, color); + setCrgbAt(i, color); } } void -LEDControl_::led_set_crgb_at(uint8_t i, cRGB crgb) { - KeyboardHardware.led_set_crgb_at(i, crgb); +LEDControl_::setCrgbAt(uint8_t i, cRGB crgb) { + KeyboardHardware.setCrgbAt(i, crgb); } void -LEDControl_::led_set_crgb_at(byte row, byte col, cRGB color) { - KeyboardHardware.led_set_crgb_at(row, col, color); +LEDControl_::setCrgbAt(byte row, byte col, cRGB color) { + KeyboardHardware.setCrgbAt(row, col, color); } cRGB -LEDControl_::led_get_crgb_at(uint8_t i) { - return KeyboardHardware.led_get_crgb_at(i); +LEDControl_::getCrgbAt(uint8_t i) { + return KeyboardHardware.getCrgbAt(i); } void -LEDControl_::led_sync(void) { - KeyboardHardware.led_sync(); +LEDControl_::syncLeds(void) { + KeyboardHardware.syncLeds(); } void @@ -156,7 +156,7 @@ LEDControl_::loopHook(bool postClear) { return; if (millis() > syncTimer) { - led_sync(); + syncLeds(); syncTimer = millis() + syncDelay; } update(); @@ -189,7 +189,7 @@ LEDControl_::focusHook(const char *command) { uint8_t idx = Serial.parseInt(); if (Serial.peek() == '\n') { - cRGB c = LEDControl.led_get_crgb_at(idx); + cRGB c = LEDControl.getCrgbAt(idx); Focus.printColor(c.r, c.g, c.b); Serial.println(); @@ -200,7 +200,7 @@ LEDControl_::focusHook(const char *command) { c.g = Serial.parseInt(); c.b = Serial.parseInt(); - LEDControl.led_set_crgb_at(idx, c); + LEDControl.setCrgbAt(idx, c); } break; } @@ -235,7 +235,7 @@ LEDControl_::focusHook(const char *command) { case THEME: { if (Serial.peek() == '\n') { for (uint8_t idx = 0; idx < LED_COUNT; idx++) { - cRGB c = LEDControl.led_get_crgb_at(idx); + cRGB c = LEDControl.getCrgbAt(idx); Focus.printColor(c.r, c.g, c.b); Focus.printSpace(); @@ -252,7 +252,7 @@ LEDControl_::focusHook(const char *command) { color.g = Serial.parseInt(); color.b = Serial.parseInt(); - LEDControl.led_set_crgb_at(idx, color); + LEDControl.setCrgbAt(idx, color); idx++; } break; diff --git a/src/Kaleidoscope-LEDControl.h b/src/Kaleidoscope-LEDControl.h index 528e147d..5ece0b2a 100644 --- a/src/Kaleidoscope-LEDControl.h +++ b/src/Kaleidoscope-LEDControl.h @@ -32,10 +32,10 @@ class LEDControl_ : public KaleidoscopePlugin { static int8_t mode_add(LEDMode *mode); - static void led_set_crgb_at(uint8_t i, cRGB crgb); - static void led_set_crgb_at(byte row, byte col, cRGB color); - static cRGB led_get_crgb_at(uint8_t i); - static void led_sync(void); + static void setCrgbAt(uint8_t i, cRGB crgb); + static void setCrgbAt(byte row, byte col, cRGB color); + static cRGB getCrgbAt(uint8_t i); + static void syncLeds(void); static void set_all_leds_to(uint8_t r, uint8_t g, uint8_t b); static void set_all_leds_to(cRGB color); diff --git a/src/LEDUtils.cpp b/src/LEDUtils.cpp index c4cc98fc..c8e98940 100644 --- a/src/LEDUtils.cpp +++ b/src/LEDUtils.cpp @@ -17,14 +17,14 @@ breath_compute() { i = (((3 * (uint16_t)(ii)) - (2 * (uint16_t)(iii))) / 2) + 2; - return hsv_to_rgb(200, 255, i); + return hsvToRgb(200, 255, i); } // From http://web.mit.edu/storborg/Public/hsvtorgb.c - talk to Scott about licensing cRGB -hsv_to_rgb(uint16_t h, uint16_t s, uint16_t v) { +hsvToRgb(uint16_t h, uint16_t s, uint16_t v) { cRGB color; /* HSV to RGB conversion function with only integer diff --git a/src/LEDUtils.h b/src/LEDUtils.h index 70929ce7..f49e6200 100644 --- a/src/LEDUtils.h +++ b/src/LEDUtils.h @@ -3,4 +3,4 @@ #include cRGB breath_compute(void); -cRGB hsv_to_rgb(uint16_t h, uint16_t s, uint16_t v); +cRGB hsvToRgb(uint16_t h, uint16_t s, uint16_t v);