From 805cffffcdbe11746040fd935745d476900509bb Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Mon, 25 Mar 2019 11:52:14 +0100 Subject: [PATCH] Allow to disable screen sleep --- keyboards/crkbd/keymaps/gamepad/config.h | 2 ++ keyboards/crkbd/keymaps/localhots/config.h | 2 ++ keyboards/crkbd/ssd1306.c | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/keyboards/crkbd/keymaps/gamepad/config.h b/keyboards/crkbd/keymaps/gamepad/config.h index 644e81365..4e975eef7 100644 --- a/keyboards/crkbd/keymaps/gamepad/config.h +++ b/keyboards/crkbd/keymaps/gamepad/config.h @@ -42,3 +42,5 @@ along with this program. If not, see . #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_VAL_STEP 17 + +// #define SCREEN_SLEEP \ No newline at end of file diff --git a/keyboards/crkbd/keymaps/localhots/config.h b/keyboards/crkbd/keymaps/localhots/config.h index 644e81365..77fb04eca 100644 --- a/keyboards/crkbd/keymaps/localhots/config.h +++ b/keyboards/crkbd/keymaps/localhots/config.h @@ -42,3 +42,5 @@ along with this program. If not, see . #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_VAL_STEP 17 + +// #define SCREEN_SLEEP diff --git a/keyboards/crkbd/ssd1306.c b/keyboards/crkbd/ssd1306.c index 4330c8497..b0dffe312 100644 --- a/keyboards/crkbd/ssd1306.c +++ b/keyboards/crkbd/ssd1306.c @@ -26,7 +26,7 @@ static const unsigned char font[] PROGMEM; //#define BatteryUpdateInterval 10000 /* milliseconds */ // 'last_flush' is declared as uint16_t, -// so this must be less than 65535 +// so this must be less than 65535 #define ScreenOffInterval 60000 /* milliseconds */ #if DEBUG_TO_SCREEN static uint8_t displaying; @@ -331,9 +331,11 @@ void iota_gfx_task(void) { force_dirty = false; } +#ifdef SCREEN_SLEEP if (timer_elapsed(last_flush) > ScreenOffInterval) { iota_gfx_off(); } +#endif } bool process_record_gfx(uint16_t keycode, keyrecord_t *record) {