diff options
author | Gergely Nagy <algernon@keyboard.io> | 2019-01-20 17:14:07 +0100 |
---|---|---|
committer | Gergely Nagy <algernon@keyboard.io> | 2019-01-20 17:17:11 +0100 |
commit | 0095044dd4af6e2fb3be5e60ffe648c4cb9b94d5 (patch) | |
tree | 8b655da8f0691944a550fbe25b9b5414e57e5d61 | |
parent | cf6234b77e96d02fb97d4d32f4edea94bdc46e09 (diff) | |
download | model01-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.ino | 2 |
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; |