diff options
Diffstat (limited to 'quantum/led_matrix.h')
-rw-r--r-- | quantum/led_matrix.h | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/quantum/led_matrix.h b/quantum/led_matrix.h index 20f2e73c6..6db162963 100644 --- a/quantum/led_matrix.h +++ b/quantum/led_matrix.h | |||
@@ -21,6 +21,11 @@ | |||
21 | #define LED_MATRIX_H | 21 | #define LED_MATRIX_H |
22 | 22 | ||
23 | 23 | ||
24 | #ifndef BACKLIGHT_ENABLE | ||
25 | #error You must define BACKLIGHT_ENABLE with LED_MATRIX_ENABLE | ||
26 | #endif | ||
27 | |||
28 | |||
24 | typedef struct Point { | 29 | typedef struct Point { |
25 | uint8_t x; | 30 | uint8_t x; |
26 | uint8_t y; | 31 | uint8_t y; |
@@ -38,7 +43,7 @@ typedef struct led_matrix { | |||
38 | uint8_t modifier:1; | 43 | uint8_t modifier:1; |
39 | } __attribute__((packed)) led_matrix; | 44 | } __attribute__((packed)) led_matrix; |
40 | 45 | ||
41 | extern const led_matrix g_leds[DRIVER_LED_TOTAL]; | 46 | extern const led_matrix g_leds[LED_DRIVER_LED_COUNT]; |
42 | 47 | ||
43 | typedef struct { | 48 | typedef struct { |
44 | uint8_t index; | 49 | uint8_t index; |
@@ -104,26 +109,11 @@ void led_matrix_decrease_speed(void); | |||
104 | void led_matrix_mode(uint8_t mode, bool eeprom_write); | 109 | void led_matrix_mode(uint8_t mode, bool eeprom_write); |
105 | void led_matrix_mode_noeeprom(uint8_t mode); | 110 | void led_matrix_mode_noeeprom(uint8_t mode); |
106 | uint8_t led_matrix_get_mode(void); | 111 | uint8_t led_matrix_get_mode(void); |
107 | void led_matrix_set_value(uint8_t mode, bool eeprom_write); | 112 | void led_matrix_set_value(uint8_t mode); |
113 | void led_matrix_set_value_noeeprom(uint8_t mode); | ||
108 | 114 | ||
109 | #ifndef BACKLIGHT_ENABLE | 115 | // Hook into the existing backlight API |
110 | #define backlight_toggle() backlight_matrix_toggle() | 116 | #define backlight_set(val) led_matrix_set_value(val) |
111 | #define backlight_enable() backlight_matrix_enable() | ||
112 | #define backlight_enable_noeeprom() backlight_matrix_enable_noeeprom() | ||
113 | #define backlight_disable() backlight_matrix_disable() | ||
114 | #define backlight_disable_noeeprom() backlight_matrix_disable_noeeprom() | ||
115 | #define backlight_step() backlight_matrix_step() | ||
116 | #define backlight_set_value(val) backlight_matrix_set_value(val) | ||
117 | #define backlight_set_value_noeeprom(val) backlight_matrix_set_value_noeeprom(val) | ||
118 | #define backlight_step_reverse() backlight_matrix_step_reverse() | ||
119 | #define backlight_increase_val() backlight_matrix_increase_val() | ||
120 | #define backlight_decrease_val() backlight_matrix_decrease_val() | ||
121 | #define backlight_increase_speed() backlight_matrix_increase_speed() | ||
122 | #define backlight_decrease_speed() backlight_matrix_decrease_speed() | ||
123 | #define backlight_mode(mode) backlight_matrix_mode(mode) | ||
124 | #define backlight_mode_noeeprom(mode) backlight_matrix_mode_noeeprom(mode) | ||
125 | #define backlight_get_mode() backlight_matrix_get_mode() | ||
126 | #endif | ||
127 | 117 | ||
128 | typedef struct { | 118 | typedef struct { |
129 | /* Perform any initialisation required for the other driver functions to work. */ | 119 | /* Perform any initialisation required for the other driver functions to work. */ |