diff options
Diffstat (limited to 'keyboards/hadron/ver3/ver3.c')
| -rw-r--r-- | keyboards/hadron/ver3/ver3.c | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/keyboards/hadron/ver3/ver3.c b/keyboards/hadron/ver3/ver3.c index 5827b42e2..1491caba4 100644 --- a/keyboards/hadron/ver3/ver3.c +++ b/keyboards/hadron/ver3/ver3.c | |||
| @@ -19,24 +19,19 @@ | |||
| 19 | #include "haptic.h" | 19 | #include "haptic.h" |
| 20 | 20 | ||
| 21 | #ifdef RGB_MATRIX_ENABLE | 21 | #ifdef RGB_MATRIX_ENABLE |
| 22 | #include "rgblight.h" | 22 | #include "rgb_matrix.h" |
| 23 | 23 | ||
| 24 | rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { | 24 | led_config_t g_led_config = { { |
| 25 | /*{row | col << 4} | 25 | { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, |
| 26 | | {x=0..224, y=0..64} | 26 | { NO_LED, 6, NO_LED, NO_LED, 7, NO_LED, NO_LED, 8, NO_LED, NO_LED, 9, NO_LED, NO_LED, 0, NO_LED }, |
| 27 | | | modifier | 27 | { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, |
| 28 | | | | */ | 28 | { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, |
| 29 | {{1|(13<<4)}, {195, 3}, 4}, | 29 | { NO_LED, 5, NO_LED, NO_LED, 4, NO_LED, NO_LED, 3, NO_LED, NO_LED, 2, NO_LED, NO_LED, 1, NO_LED } |
| 30 | {{4|(13<<4)}, {195, 16}, 4}, | 30 | }, { |
| 31 | {{4|(10<<4)}, {150, 16}, 4}, | 31 | { 195, 3 }, { 195, 16 }, { 150, 16 }, { 105, 16 }, { 60, 16 }, { 15, 16 }, { 15, 3 }, { 60, 3 }, { 105, 3 }, { 150, 3 } |
| 32 | {{4|(7<<4)}, {105, 16}, 4}, | 32 | }, { |
| 33 | {{4|(4<<4)}, {60, 16}, 4}, | 33 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 |
| 34 | {{4|(1<<4)}, {15, 16}, 4}, | 34 | } }; |
| 35 | {{1|(1<<4)}, {15, 3}, 4}, | ||
| 36 | {{1|(4<<4)}, {60, 3}, 4}, | ||
| 37 | {{1|(7<<4)}, {105, 3}, 4}, | ||
| 38 | {{1|(10<<4)}, {150, 3}, 4} | ||
| 39 | }; | ||
| 40 | 35 | ||
| 41 | #endif | 36 | #endif |
| 42 | 37 | ||
| @@ -53,12 +48,12 @@ uint16_t counterst = 0; | |||
| 53 | #define ScreenOffInterval 60000 /* milliseconds */ | 48 | #define ScreenOffInterval 60000 /* milliseconds */ |
| 54 | static uint16_t last_flush; | 49 | static uint16_t last_flush; |
| 55 | 50 | ||
| 56 | volatile uint8_t led_numlock = false; | 51 | volatile uint8_t led_numlock = false; |
| 57 | volatile uint8_t led_capslock = false; | 52 | volatile uint8_t led_capslock = false; |
| 58 | volatile uint8_t led_scrolllock = false; | 53 | volatile uint8_t led_scrolllock = false; |
| 59 | 54 | ||
| 60 | static uint8_t layer; | 55 | static uint8_t layer; |
| 61 | static bool queue_for_send = false; | 56 | static bool queue_for_send = false; |
| 62 | static uint8_t encoder_value = 32; | 57 | static uint8_t encoder_value = 32; |
| 63 | 58 | ||
| 64 | __attribute__ ((weak)) | 59 | __attribute__ ((weak)) |
| @@ -69,7 +64,7 @@ void draw_ui(void) { | |||
| 69 | 64 | ||
| 70 | /* Layer indicator is 41 x 10 pixels */ | 65 | /* Layer indicator is 41 x 10 pixels */ |
| 71 | #define LAYER_INDICATOR_X 5 | 66 | #define LAYER_INDICATOR_X 5 |
| 72 | #define LAYER_INDICATOR_Y 0 | 67 | #define LAYER_INDICATOR_Y 0 |
| 73 | 68 | ||
| 74 | draw_string(LAYER_INDICATOR_X + 1, LAYER_INDICATOR_Y + 2, "LAYER", PIXEL_ON, NORM, 0); | 69 | draw_string(LAYER_INDICATOR_X + 1, LAYER_INDICATOR_Y + 2, "LAYER", PIXEL_ON, NORM, 0); |
| 75 | draw_rect_filled_soft(LAYER_INDICATOR_X + 32, LAYER_INDICATOR_Y + 1, 9, 9, PIXEL_ON, NORM); | 70 | draw_rect_filled_soft(LAYER_INDICATOR_X + 32, LAYER_INDICATOR_Y + 1, 9, 9, PIXEL_ON, NORM); |
| @@ -83,7 +78,7 @@ void draw_ui(void) { | |||
| 83 | for (uint8_t y = 0; y < MATRIX_COLS; y++) { | 78 | for (uint8_t y = 0; y < MATRIX_COLS; y++) { |
| 84 | draw_pixel(MATRIX_DISPLAY_X + y + 2, MATRIX_DISPLAY_Y + x + 2,(matrix_get_row(x) & (1 << y)) > 0, NORM); | 79 | draw_pixel(MATRIX_DISPLAY_X + y + 2, MATRIX_DISPLAY_Y + x + 2,(matrix_get_row(x) & (1 << y)) > 0, NORM); |
| 85 | } | 80 | } |
| 86 | } | 81 | } |
| 87 | draw_rect_soft(MATRIX_DISPLAY_X, MATRIX_DISPLAY_Y, 19, 9, PIXEL_ON, NORM); | 82 | draw_rect_soft(MATRIX_DISPLAY_X, MATRIX_DISPLAY_Y, 19, 9, PIXEL_ON, NORM); |
| 88 | /* hadron oled location on thumbnail */ | 83 | /* hadron oled location on thumbnail */ |
| 89 | draw_rect_filled_soft(MATRIX_DISPLAY_X + 14, MATRIX_DISPLAY_Y + 2, 3, 1, PIXEL_ON, NORM); | 84 | draw_rect_filled_soft(MATRIX_DISPLAY_X + 14, MATRIX_DISPLAY_Y + 2, 3, 1, PIXEL_ON, NORM); |
| @@ -162,7 +157,7 @@ void read_host_led_state(void) { | |||
| 162 | if (led_capslock == false){ | 157 | if (led_capslock == false){ |
| 163 | led_capslock = true;} | 158 | led_capslock = true;} |
| 164 | } else { | 159 | } else { |
| 165 | if (led_capslock == true){ | 160 | if (led_capslock == true){ |
| 166 | led_capslock = false;} | 161 | led_capslock = false;} |
| 167 | } | 162 | } |
| 168 | if (leds & (1 << USB_LED_SCROLL_LOCK)) { | 163 | if (leds & (1 << USB_LED_SCROLL_LOCK)) { |
| @@ -197,7 +192,7 @@ void matrix_init_kb(void) { | |||
| 197 | queue_for_send = true; | 192 | queue_for_send = true; |
| 198 | matrix_init_user(); | 193 | matrix_init_user(); |
| 199 | } | 194 | } |
| 200 | 195 | ||
| 201 | void matrix_scan_kb(void) { | 196 | void matrix_scan_kb(void) { |
| 202 | if (queue_for_send) { | 197 | if (queue_for_send) { |
| 203 | #ifdef QWIIC_MICRO_OLED_ENABLE | 198 | #ifdef QWIIC_MICRO_OLED_ENABLE |
