summaryrefslogtreecommitdiff
path: root/keyboards/helix/ssd1306.c
diff options
context:
space:
mode:
authorAlex Ong <the.onga@gmail.com>2019-01-04 19:43:45 +1100
committerAlex Ong <the.onga@gmail.com>2019-01-04 19:43:45 +1100
commit2bb2977c133646c4e056960e72029270d77cc1eb (patch)
tree235d491f992121ac1716c5bf2fafb80983748576 /keyboards/helix/ssd1306.c
parenta55c838961c89097ab849ed6cb1f261791e6b9b4 (diff)
parent47c91fc7f75ae0a477e55b687aa0fc30da0a283c (diff)
Merge branch 'master' into debounce_refactor
# Conflicts: # tmk_core/common/keyboard.c
Diffstat (limited to 'keyboards/helix/ssd1306.c')
-rw-r--r--keyboards/helix/ssd1306.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/keyboards/helix/ssd1306.c b/keyboards/helix/ssd1306.c
index b3e55a67c2..dd3290ba0c 100644
--- a/keyboards/helix/ssd1306.c
+++ b/keyboards/helix/ssd1306.c
@@ -1,3 +1,4 @@
+
#ifdef SSD1306OLED
#include "ssd1306.h"
@@ -27,12 +28,17 @@
//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) {
@@ -318,12 +324,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