diff options
Diffstat (limited to 'users/ninjonas/oled.c')
-rw-r--r-- | users/ninjonas/oled.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/users/ninjonas/oled.c b/users/ninjonas/oled.c index 8a9c99593..721038e15 100644 --- a/users/ninjonas/oled.c +++ b/users/ninjonas/oled.c | |||
@@ -4,12 +4,19 @@ | |||
4 | 4 | ||
5 | #ifdef OLED_DRIVER_ENABLE | 5 | #ifdef OLED_DRIVER_ENABLE |
6 | 6 | ||
7 | static uint16_t oled_timer = 0; | 7 | static uint32_t oled_timer = 0; |
8 | extern uint8_t is_master; | 8 | extern uint8_t is_master; |
9 | 9 | ||
10 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | ||
11 | if (is_master) { | ||
12 | return OLED_ROTATION_0; | ||
13 | } | ||
14 | return OLED_ROTATION_180; | ||
15 | } | ||
16 | |||
10 | bool process_record_oled(uint16_t keycode, keyrecord_t *record) { | 17 | bool process_record_oled(uint16_t keycode, keyrecord_t *record) { |
11 | if (record->event.pressed) { | 18 | if (record->event.pressed) { |
12 | oled_timer = timer_read(); | 19 | oled_timer = timer_read32(); |
13 | } | 20 | } |
14 | return true; | 21 | return true; |
15 | } | 22 | } |
@@ -64,7 +71,7 @@ static void render_logo(void) { | |||
64 | } | 71 | } |
65 | 72 | ||
66 | void oled_task_user(void) { | 73 | void oled_task_user(void) { |
67 | if (timer_elapsed(oled_timer) > 30000) { | 74 | if (timer_elapsed32(oled_timer) > 30000) { |
68 | oled_off(); | 75 | oled_off(); |
69 | return; | 76 | return; |
70 | } | 77 | } |
@@ -75,8 +82,8 @@ void oled_task_user(void) { | |||
75 | if (is_master) { | 82 | if (is_master) { |
76 | render_status(); | 83 | render_status(); |
77 | } else { | 84 | } else { |
78 | oled_write_P(PSTR("\n"), false); | ||
79 | render_logo(); | 85 | render_logo(); |
86 | oled_write_P(PSTR("\n"), false); | ||
80 | oled_scroll_left(); | 87 | oled_scroll_left(); |
81 | } | 88 | } |
82 | } | 89 | } |