diff options
-rw-r--r-- | keyboards/helix/pico/pico.c | 6 | ||||
-rw-r--r-- | keyboards/helix/rev1/rev1.c | 6 | ||||
-rw-r--r-- | keyboards/helix/rev2/rev2.c | 6 | ||||
-rw-r--r-- | keyboards/helix/ssd1306.c | 17 | ||||
-rw-r--r-- | keyboards/helix/ssd1306.h | 3 |
5 files changed, 35 insertions, 3 deletions
diff --git a/keyboards/helix/pico/pico.c b/keyboards/helix/pico/pico.c index 5e248ccff..bb8ba9ca2 100644 --- a/keyboards/helix/pico/pico.c +++ b/keyboards/helix/pico/pico.c | |||
@@ -2,6 +2,12 @@ | |||
2 | 2 | ||
3 | 3 | ||
4 | #ifdef SSD1306OLED | 4 | #ifdef SSD1306OLED |
5 | #include "ssd1306.h" | ||
6 | |||
7 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
8 | return process_record_gfx(keycode,record) && process_record_user(keycode, record); | ||
9 | } | ||
10 | |||
5 | void led_set_kb(uint8_t usb_led) { | 11 | void led_set_kb(uint8_t usb_led) { |
6 | // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here | 12 | // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here |
7 | //led_set_user(usb_led); | 13 | //led_set_user(usb_led); |
diff --git a/keyboards/helix/rev1/rev1.c b/keyboards/helix/rev1/rev1.c index d7ea9b723..309cca010 100644 --- a/keyboards/helix/rev1/rev1.c +++ b/keyboards/helix/rev1/rev1.c | |||
@@ -2,6 +2,12 @@ | |||
2 | 2 | ||
3 | 3 | ||
4 | #ifdef SSD1306OLED | 4 | #ifdef SSD1306OLED |
5 | #include "ssd1306.h" | ||
6 | |||
7 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
8 | return process_record_gfx(keycode,record) && process_record_user(keycode, record); | ||
9 | } | ||
10 | |||
5 | void led_set_kb(uint8_t usb_led) { | 11 | void led_set_kb(uint8_t usb_led) { |
6 | // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here | 12 | // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here |
7 | led_set_user(usb_led); | 13 | led_set_user(usb_led); |
diff --git a/keyboards/helix/rev2/rev2.c b/keyboards/helix/rev2/rev2.c index 75765f1d3..abaa02cdb 100644 --- a/keyboards/helix/rev2/rev2.c +++ b/keyboards/helix/rev2/rev2.c | |||
@@ -2,6 +2,12 @@ | |||
2 | 2 | ||
3 | 3 | ||
4 | #ifdef SSD1306OLED | 4 | #ifdef SSD1306OLED |
5 | #include "ssd1306.h" | ||
6 | |||
7 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
8 | return process_record_gfx(keycode,record) && process_record_user(keycode, record); | ||
9 | } | ||
10 | |||
5 | void led_set_kb(uint8_t usb_led) { | 11 | void led_set_kb(uint8_t usb_led) { |
6 | // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here | 12 | // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here |
7 | //led_set_user(usb_led); | 13 | //led_set_user(usb_led); |
diff --git a/keyboards/helix/ssd1306.c b/keyboards/helix/ssd1306.c index b3e55a67c..dd3290ba0 100644 --- a/keyboards/helix/ssd1306.c +++ b/keyboards/helix/ssd1306.c | |||
@@ -1,3 +1,4 @@ | |||
1 | |||
1 | #ifdef SSD1306OLED | 2 | #ifdef SSD1306OLED |
2 | 3 | ||
3 | #include "ssd1306.h" | 4 | #include "ssd1306.h" |
@@ -27,12 +28,17 @@ | |||
27 | //static uint16_t last_battery_update; | 28 | //static uint16_t last_battery_update; |
28 | //static uint32_t vbat; | 29 | //static uint32_t vbat; |
29 | //#define BatteryUpdateInterval 10000 /* milliseconds */ | 30 | //#define BatteryUpdateInterval 10000 /* milliseconds */ |
30 | #define ScreenOffInterval 300000 /* milliseconds */ | 31 | |
32 | // 'last_flush' is declared as uint16_t, | ||
33 | // so this must be less than 65535 | ||
34 | #define ScreenOffInterval 60000 /* milliseconds */ | ||
31 | #if DEBUG_TO_SCREEN | 35 | #if DEBUG_TO_SCREEN |
32 | static uint8_t displaying; | 36 | static uint8_t displaying; |
33 | #endif | 37 | #endif |
34 | static uint16_t last_flush; | 38 | static uint16_t last_flush; |
35 | 39 | ||
40 | static bool force_dirty = true; | ||
41 | |||
36 | // Write command sequence. | 42 | // Write command sequence. |
37 | // Returns true on success. | 43 | // Returns true on success. |
38 | static inline bool _send_cmd1(uint8_t cmd) { | 44 | static inline bool _send_cmd1(uint8_t cmd) { |
@@ -318,12 +324,19 @@ void iota_gfx_task_user(void) { | |||
318 | void iota_gfx_task(void) { | 324 | void iota_gfx_task(void) { |
319 | iota_gfx_task_user(); | 325 | iota_gfx_task_user(); |
320 | 326 | ||
321 | if (display.dirty) { | 327 | if (display.dirty|| force_dirty) { |
322 | iota_gfx_flush(); | 328 | iota_gfx_flush(); |
329 | force_dirty = false; | ||
323 | } | 330 | } |
324 | 331 | ||
325 | if (timer_elapsed(last_flush) > ScreenOffInterval) { | 332 | if (timer_elapsed(last_flush) > ScreenOffInterval) { |
326 | iota_gfx_off(); | 333 | iota_gfx_off(); |
327 | } | 334 | } |
328 | } | 335 | } |
336 | |||
337 | bool process_record_gfx(uint16_t keycode, keyrecord_t *record) { | ||
338 | force_dirty = true; | ||
339 | return true; | ||
340 | } | ||
341 | |||
329 | #endif | 342 | #endif |
diff --git a/keyboards/helix/ssd1306.h b/keyboards/helix/ssd1306.h index 77ce7c211..9cf6983b7 100644 --- a/keyboards/helix/ssd1306.h +++ b/keyboards/helix/ssd1306.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <stdbool.h> | 4 | #include <stdbool.h> |
5 | #include <stdio.h> | 5 | #include <stdio.h> |
6 | #include "pincontrol.h" | 6 | #include "pincontrol.h" |
7 | #include "action.h" | ||
7 | 8 | ||
8 | enum ssd1306_cmds { | 9 | enum ssd1306_cmds { |
9 | DisplayOff = 0xAE, | 10 | DisplayOff = 0xAE, |
@@ -87,6 +88,6 @@ void matrix_write(struct CharacterMatrix *matrix, const char *data); | |||
87 | void matrix_write_P(struct CharacterMatrix *matrix, const char *data); | 88 | void matrix_write_P(struct CharacterMatrix *matrix, const char *data); |
88 | void matrix_render(struct CharacterMatrix *matrix); | 89 | void matrix_render(struct CharacterMatrix *matrix); |
89 | 90 | ||
90 | 91 | bool process_record_gfx(uint16_t keycode, keyrecord_t *record); | |
91 | 92 | ||
92 | #endif | 93 | #endif |