diff --git a/KeyboardConfig.cpp b/KeyboardConfig.cpp index 77074dab..33d5238e 100644 --- a/KeyboardConfig.cpp +++ b/KeyboardConfig.cpp @@ -6,6 +6,9 @@ HARDWARE_IMPLEMENTATION KeyboardHardware; void led_set_crgb_at(uint8_t i, cRGB crgb) { KeyboardHardware.led_set_crgb_at(i,crgb); } +cRGB led_get_crgb_at(uint8_t i){ + KeyboardHardware.led_get_crgb_at(i); +} void led_sync(void) { KeyboardHardware.led_sync(); } diff --git a/KeyboardConfig.h b/KeyboardConfig.h index 0b871a7d..8933c6a3 100644 --- a/KeyboardConfig.h +++ b/KeyboardConfig.h @@ -10,6 +10,7 @@ // and the 'userspace' LED implementation. If my C++ were stronger, there woudl // certainly be a better way -JV 2016-02-01 void led_set_crgb_at(uint8_t i, cRGB crgb); +cRGB led_get_crgb_at(uint8_t i); void led_sync(void); diff --git a/implementation/Model01.cpp b/implementation/Model01.cpp index 72e071b1..e42593f6 100644 --- a/implementation/Model01.cpp +++ b/implementation/Model01.cpp @@ -45,6 +45,14 @@ void Model01::led_set_crgb_at(uint8_t i, cRGB crgb) { } } +cRGB Model01::led_get_crgb_at(uint8_t i) { + if(i<32) { + return leftHand.ledData.leds[i]; + } else if (i<64) { + return rightHand.ledData.leds[i-32] ; + } +} + void Model01::led_sync() { rightHand.sendLEDData(); rightHand.sendLEDData(); diff --git a/implementation/Model01.h b/implementation/Model01.h index 001e516c..a7d0046b 100644 --- a/implementation/Model01.h +++ b/implementation/Model01.h @@ -20,6 +20,7 @@ class Model01 { void led_sync(void); void led_set_crgb_at(byte row, byte col, cRGB color); void led_set_crgb_at(uint8_t i, cRGB crgb); + cRGB led_get_crgb_at(uint8_t i); cRGB get_key_color(byte row, byte col); void scan_matrix(void);