summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGergely Nagy <algernon@keyboard.io>2019-01-20 17:14:07 +0100
committerGergely Nagy <algernon@keyboard.io>2019-01-20 17:17:11 +0100
commit0095044dd4af6e2fb3be5e60ffe648c4cb9b94d5 (patch)
tree8b655da8f0691944a550fbe25b9b5414e57e5d61
parentcf6234b77e96d02fb97d4d32f4edea94bdc46e09 (diff)
downloadmodel01-firmware-0095044dd4af6e2fb3be5e60ffe648c4cb9b94d5.tar.gz
model01-firmware-0095044dd4af6e2fb3be5e60ffe648c4cb9b94d5.tar.bz2
model01-firmware-0095044dd4af6e2fb3be5e60ffe648c4cb9b94d5.zip
Fix turning LEDs off on suspend
When suspending, we want to set all LEDs off & sync first, and only then pause LED operations. When the code was originally written, `LEDControl.syncLeds()` synced LEDs even when `LEDControl.paused` was set - it no longer does so, so we need to pause after we synced. This addresses keyboardio/Kaleidoscope#516, at least partially. Signed-off-by: Gergely Nagy <algernon@keyboard.io>
-rw-r--r--Model01-Firmware.ino2
1 files changed, 1 insertions, 1 deletions
diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino
index 58b3ebe..0178726 100644
--- a/Model01-Firmware.ino
+++ b/Model01-Firmware.ino
@@ -355,9 +355,9 @@ static kaleidoscope::plugin::LEDSolidColor solidViolet(130, 0, 120);
void toggleLedsOnSuspendResume(kaleidoscope::plugin::HostPowerManagement::Event event) {
switch (event) {
case kaleidoscope::plugin::HostPowerManagement::Suspend:
- LEDControl.paused = true;
LEDControl.set_all_leds_to({0, 0, 0});
LEDControl.syncLeds();
+ LEDControl.paused = true;
break;
case kaleidoscope::plugin::HostPowerManagement::Resume:
LEDControl.paused = false;