diff options
author | Andrew Kannan <andrew.kannan@klaviyo.com> | 2019-03-11 23:47:50 -0400 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-03-11 20:47:50 -0700 |
commit | e046872a80263df895a759a55e72ed51cfa70ae7 (patch) | |
tree | c84fc6e02edc28a6c17b7ecfd9b5054a852a0615 /keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c | |
parent | fd43259cbd09dda47087bb45aecf80a77cdc4c58 (diff) |
[Keyboard] Satisfaction75 Protoype/Rev1 split, and new VIA features (#5303)
* Add satisfaction75 revision 1
* Update manufacturer
* Add tester layout and update rev1 comments
* Add ifdef guards for OLED for tester
* Add oled disabling rules
* Update to save backlight settings and setup for VIA custom config
* Add new VIA values to satisfaction75
* Safety guard in clock set mode
* Fix mistaken doc edit
* Address PR comments
* bring the default back to pass travis CI
* Address further PR comments
Diffstat (limited to 'keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c')
-rw-r--r-- | keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c b/keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c index 88996f829d..6776816918 100644 --- a/keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c +++ b/keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c @@ -10,6 +10,8 @@ void pre_encoder_mode_change(){ // timespec.dstflag = last_timespec.dstflag; timespec.millisecond = (hour_config * 60 + minute_config) * 60 * 1000; rtcSetTime(&RTCD1, ×pec); + } else if (encoder_mode == ENC_MODE_BACKLIGHT){ + save_backlight_config_to_eeprom(); } } @@ -26,6 +28,9 @@ void post_encoder_mode_change(){ void change_encoder_mode(bool negative){ pre_encoder_mode_change(); + if(enabled_encoder_modes == 0){ + enabled_encoder_modes = 0x1F; + } do { if(negative){ if (encoder_mode == 0){ @@ -94,12 +99,14 @@ uint16_t handle_encoder_clockwise(){ mapped_code = KC_WH_D; break; case ENC_MODE_BACKLIGHT: - // mapped_code = BL_INC; kb_backlight_config.level = kb_backlight_config.level + 1; if(kb_backlight_config.level > BACKLIGHT_LEVELS){ kb_backlight_config.level = BACKLIGHT_LEVELS; } backlight_set(kb_backlight_config.level); + if (kb_backlight_config.level != 0){ + kb_backlight_config.enable = true; + } break; case ENC_MODE_BRIGHTNESS: mapped_code = KC_BRIGHTNESS_UP; @@ -131,6 +138,9 @@ uint16_t handle_encoder_ccw(){ kb_backlight_config.level = kb_backlight_config.level - 1; } backlight_set(kb_backlight_config.level); + if (kb_backlight_config.level == 0){ + kb_backlight_config.enable = false; + } break; case ENC_MODE_BRIGHTNESS: mapped_code = KC_BRIGHTNESS_DOWN; |