diff options
author | comaid <[email protected]> | 2018-11-13 05:19:29 +0900 |
---|---|---|
committer | Drashna Jaelre <[email protected]> | 2018-11-12 12:19:29 -0800 |
commit | aa03049015855cdd5f61e6e8a7c6955abc5d3141 (patch) | |
tree | c63eb623ddb31e454dabef738ce6be16410b77cb /keyboards/crkbd/ssd1306.c | |
parent | b1e74aee43596e2601248b0a78b2c54c897ce78b (diff) | |
download | qmk_firmware-aa03049015855cdd5f61e6e8a7c6955abc5d3141.tar.gz qmk_firmware-aa03049015855cdd5f61e6e8a7c6955abc5d3141.zip |
Fix up screen off timer of crkbd (#4346)
* fix about screen off timer
* Fix Up ScreenOffInterval exceeded uint16_t
* Fix Up never waking up once screen off if in case of matrix are not dirty.
* Revert "fix about screen off timer"
This reverts commit 3d175f2340c14250a71af78afec5a1e890d9f4e7.
* Fix up screen off timer of crkbd
* Fix Up ScreenOffInterval exceeded uint16_t
* Fix Up never waking up once screen off if in case of matrix are not dirty.
* Fix up screen off timer of helix
* Fix Up ScreenOffInterval exceeded uint16_t
* Fix Up never waking up once screen off if in case of matrix are not dirty
* Revert "Fix up screen off timer of helix"
This reverts commit f0efb82443a7dc34b75579359b0514e8bfa51100.
* Improve internal processing of process_record_kb()
* Use the return value of process_record_gfx()
* Fix a indent
Fix a indent
Diffstat (limited to 'keyboards/crkbd/ssd1306.c')
-rw-r--r-- | keyboards/crkbd/ssd1306.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/keyboards/crkbd/ssd1306.c b/keyboards/crkbd/ssd1306.c index 205ce67a9e..4330c8497d 100644 --- a/keyboards/crkbd/ssd1306.c +++ b/keyboards/crkbd/ssd1306.c @@ -24,12 +24,17 @@ static const unsigned char font[] PROGMEM; //static uint16_t last_battery_update; //static uint32_t vbat; //#define BatteryUpdateInterval 10000 /* milliseconds */ -#define ScreenOffInterval 300000 /* milliseconds */ + +// 'last_flush' is declared as uint16_t, +// so this must be less than 65535 +#define ScreenOffInterval 60000 /* milliseconds */ #if DEBUG_TO_SCREEN static uint8_t displaying; #endif static uint16_t last_flush; +static bool force_dirty = true; + // Write command sequence. // Returns true on success. static inline bool _send_cmd1(uint8_t cmd) { @@ -321,12 +326,19 @@ void iota_gfx_task_user(void) { void iota_gfx_task(void) { iota_gfx_task_user(); - if (display.dirty) { + if (display.dirty|| force_dirty) { iota_gfx_flush(); + force_dirty = false; } if (timer_elapsed(last_flush) > ScreenOffInterval) { iota_gfx_off(); } } + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record) { + force_dirty = true; + return true; +} + #endif |