diff options
Diffstat (limited to 'users/drashna/oled_stuff.c')
-rw-r--r-- | users/drashna/oled_stuff.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/users/drashna/oled_stuff.c b/users/drashna/oled_stuff.c index 7811cabc6..4b5491950 100644 --- a/users/drashna/oled_stuff.c +++ b/users/drashna/oled_stuff.c | |||
@@ -16,6 +16,8 @@ | |||
16 | 16 | ||
17 | #include "drashna.h" | 17 | #include "drashna.h" |
18 | 18 | ||
19 | extern bool host_driver_disabled; | ||
20 | |||
19 | #ifndef KEYLOGGER_LENGTH | 21 | #ifndef KEYLOGGER_LENGTH |
20 | // # ifdef OLED_DISPLAY_128X64 | 22 | // # ifdef OLED_DISPLAY_128X64 |
21 | # define KEYLOGGER_LENGTH ((uint8_t)(OLED_DISPLAY_HEIGHT / OLED_FONT_WIDTH)) | 23 | # define KEYLOGGER_LENGTH ((uint8_t)(OLED_DISPLAY_HEIGHT / OLED_FONT_WIDTH)) |
@@ -29,24 +31,24 @@ static char keylog_str[KEYLOGGER_LENGTH + 1] = {0}; | |||
29 | static uint16_t log_timer = 0; | 31 | static uint16_t log_timer = 0; |
30 | 32 | ||
31 | // clang-format off | 33 | // clang-format off |
32 | static const char PROGMEM code_to_name[0xFF] = { | 34 | static const char PROGMEM code_to_name[256] = { |
33 | // 0 1 2 3 4 5 6 7 8 9 A B c D E F | 35 | // 0 1 2 3 4 5 6 7 8 9 A B c D E F |
34 | ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', // 0x | 36 | ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', // 0x |
35 | 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', // 1x | 37 | 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', // 1x |
36 | '3', '4', '5', '6', '7', '8', '9', '0', 20, 19, 27, 26, 22, '-', '=', '[', // 2x | 38 | '3', '4', '5', '6', '7', '8', '9', '0', 20, 19, 27, 26, 22, '-', '=', '[', // 2x |
37 | ']','\\', '#', ';','\'', '`', ',', '.', '/', 128, ' ', ' ', ' ', ' ', ' ', ' ', // 3x | 39 | ']','\\', '#', ';','\'', '`', ',', '.', '/', 128, '1', '2', '3', '4', '5', '6', // 3x |
38 | ' ', ' ', ' ', ' ', ' ', ' ', 'P', 'S', ' ', ' ', ' ', ' ', 16, ' ', ' ', ' ', // 4x | 40 | '7', '8', '9', '0', '1', '2', 'P', 'S', 19, ' ', 17, 30, 16, 16, 31, 26, // 4x |
39 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 5x | 41 | 27, 25, 24, 'N', '/', '*', '-', '+', 23, '1', '2', '3', '4', '5', '6', '7', // 5x |
40 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 6x | 42 | '8', '9', '0', '.','\\', 'A', 0, '=', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 6x |
41 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 7x | 43 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 7x |
42 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 8x | 44 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 8x |
43 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 9x | 45 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 9x |
44 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ax | 46 | ' ', ' ', ' ', ' ', ' ', 0, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ax |
45 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Bx | 47 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Bx |
46 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Cx | 48 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Cx |
47 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Dx | 49 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Dx |
48 | 'C', 'S', 'A', 'C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ex | 50 | 'C', 'S', 'A', 'C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 24, 26, 24, // Ex |
49 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' // Fx | 51 | 25,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D, 24, 25, 27, 26, ' ', ' ', ' ' // Fx |
50 | }; | 52 | }; |
51 | // clang-format on | 53 | // clang-format on |
52 | 54 | ||
@@ -148,8 +150,8 @@ void render_keylock_status(uint8_t led_usb_state) { | |||
148 | oled_write_P(PSTR(OLED_RENDER_LOCK_NUML), led_usb_state & (1 << USB_LED_NUM_LOCK)); | 150 | oled_write_P(PSTR(OLED_RENDER_LOCK_NUML), led_usb_state & (1 << USB_LED_NUM_LOCK)); |
149 | oled_write_P(PSTR(" "), false); | 151 | oled_write_P(PSTR(" "), false); |
150 | oled_write_P(PSTR(OLED_RENDER_LOCK_CAPS), led_usb_state & (1 << USB_LED_CAPS_LOCK)); | 152 | oled_write_P(PSTR(OLED_RENDER_LOCK_CAPS), led_usb_state & (1 << USB_LED_CAPS_LOCK)); |
151 | oled_write_P(PSTR(" "), false); | 153 | // oled_write_P(PSTR(" "), false); |
152 | oled_write_P(PSTR(OLED_RENDER_LOCK_SCLK), led_usb_state & (1 << USB_LED_SCROLL_LOCK)); | 154 | // oled_write_P(PSTR(OLED_RENDER_LOCK_SCLK), led_usb_state & (1 << USB_LED_SCROLL_LOCK)); |
153 | } | 155 | } |
154 | 156 | ||
155 | void render_matrix_scan_rate(void) { | 157 | void render_matrix_scan_rate(void) { |
@@ -292,12 +294,22 @@ void render_user_status(void) { | |||
292 | 294 | ||
293 | static const char PROGMEM rgb_layer_status[2][3] = {{0xEE, 0xEF, 0}, {0xF0, 0xF1, 0}}; | 295 | static const char PROGMEM rgb_layer_status[2][3] = {{0xEE, 0xEF, 0}, {0xF0, 0xF1, 0}}; |
294 | oled_write_P(rgb_layer_status[userspace_config.rgb_layer_change], false); | 296 | oled_write_P(rgb_layer_status[userspace_config.rgb_layer_change], false); |
295 | static const char PROGMEM nukem_good[2][3] = {{0xF8, 0xF9, 0}, {0xF6, 0xF7, 0}}; | 297 | static const char PROGMEM cat_mode[2][3] = {{0xF8, 0xF9, 0}, {0xF6, 0xF7, 0}}; |
296 | oled_write_P(nukem_good[0], userspace_config.nuke_switch); | 298 | oled_write_P(cat_mode[0], host_driver_disabled); |
297 | #if defined(UNICODE_ENABLE) | 299 | #if defined(UNICODE_ENABLE) |
298 | static const char PROGMEM uc_mod_status[5][3] = {{0xEA, 0xEB, 0}, {0xEC, 0xED, 0}}; | 300 | static const char PROGMEM uc_mod_status[5][3] = {{0xEA, 0xEB, 0}, {0xEC, 0xED, 0}}; |
299 | oled_write_P(uc_mod_status[get_unicode_input_mode() == UC_MAC], false); | 301 | oled_write_P(uc_mod_status[get_unicode_input_mode() == UC_MAC], false); |
300 | #endif | 302 | #endif |
303 | if (userspace_config.nuke_switch) { | ||
304 | #if !defined(OLED_DISPLAY_128X64) | ||
305 | oled_write_P(PSTR(" "), false); | ||
306 | #endif | ||
307 | static const char PROGMEM nukem_good[2] = {0xFA, 0}; | ||
308 | oled_write_P(nukem_good, false); | ||
309 | #if !defined(OLED_DISPLAY_128X64) | ||
310 | oled_advance_page(true); | ||
311 | #endif | ||
312 | } | ||
301 | #if defined(OLED_DISPLAY_128X64) | 313 | #if defined(OLED_DISPLAY_128X64) |
302 | oled_advance_page(true); | 314 | oled_advance_page(true); |
303 | #endif | 315 | #endif |