From e046872a80263df895a759a55e72ed51cfa70ae7 Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Mon, 11 Mar 2019 23:47:50 -0400 Subject: [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 --- keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c') 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; -- cgit v1.2.3