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/
pull/365/head
Jesse Vincent 7 years ago
parent a8faa2d594
commit a84060e8d1
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -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

@ -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;

@ -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);

@ -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

@ -3,4 +3,4 @@
#include <Kaleidoscope.h>
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);

Loading…
Cancel
Save