OpenAnnePro / qmk_firmware

This has since been merged back to mainline QMK. Please use qmk/qmk_firmware
https://qmk.fm
GNU General Public License v2.0
196 stars 64 forks source link

Improve logic for switching off and on of LEDs #16

Closed kdarkhan closed 3 years ago

kdarkhan commented 3 years ago

To enable LEDs we need to send the signal to enable the LED and then trigger the profile. For triggering the profile, current logic calls annepro2LedNextProfile() which makes it convenient to reuse the same key for both enabling and switching to next profiles. Because of that when we enable LEDs, we always end up at the next profile instead of the one we previously used. A workaround was to switch to previous profile in the KC_AP_LED_OFF handler. That made both KC_AP_LED_OFF and KC_AP_LED_ON unnecessarily complex and flicker was noticeable when using those keys. In addition, if using KC_AP_LED_ON instead of KC_AP_LED_NEXT_PROFILE, it was slower. My fix is to not make the extra calls.

This needs a small change in the shine repo which is provided here

Codetector1374 commented 3 years ago

LGTM