diff options
| author | skullY <skullydazed@gmail.com> | 2019-08-30 11:19:03 -0700 |
|---|---|---|
| committer | skullydazed <skullydazed@users.noreply.github.com> | 2019-08-30 15:01:52 -0700 |
| commit | b624f32f944acdc59dcb130674c09090c5c404cb (patch) | |
| tree | bc13adbba137d122d9a2c2fb2fafcbb08ac10e25 /quantum/ledmatrix.h | |
| parent | 61af76a10d00aba185b8338604171de490a13e3b (diff) | |
| download | qmk_firmware-b624f32f944acdc59dcb130674c09090c5c404cb.tar.gz qmk_firmware-b624f32f944acdc59dcb130674c09090c5c404cb.zip | |
clang-format changes
Diffstat (limited to 'quantum/ledmatrix.h')
| -rw-r--r-- | quantum/ledmatrix.h | 78 |
1 files changed, 38 insertions, 40 deletions
diff --git a/quantum/ledmatrix.h b/quantum/ledmatrix.h index 618c5d676..5867ba987 100644 --- a/quantum/ledmatrix.h +++ b/quantum/ledmatrix.h | |||
| @@ -20,46 +20,44 @@ | |||
| 20 | #ifndef LED_MATRIX_H | 20 | #ifndef LED_MATRIX_H |
| 21 | #define LED_MATRIX_H | 21 | #define LED_MATRIX_H |
| 22 | 22 | ||
| 23 | |||
| 24 | #ifndef BACKLIGHT_ENABLE | 23 | #ifndef BACKLIGHT_ENABLE |
| 25 | #error You must define BACKLIGHT_ENABLE with LED_MATRIX_ENABLE | 24 | # error You must define BACKLIGHT_ENABLE with LED_MATRIX_ENABLE |
| 26 | #endif | 25 | #endif |
| 27 | 26 | ||
| 28 | |||
| 29 | typedef struct Point { | 27 | typedef struct Point { |
| 30 | uint8_t x; | 28 | uint8_t x; |
| 31 | uint8_t y; | 29 | uint8_t y; |
| 32 | } __attribute__((packed)) Point; | 30 | } __attribute__((packed)) Point; |
| 33 | 31 | ||
| 34 | typedef struct led_matrix { | 32 | typedef struct led_matrix { |
| 35 | union { | 33 | union { |
| 36 | uint8_t raw; | 34 | uint8_t raw; |
| 37 | struct { | 35 | struct { |
| 38 | uint8_t row:4; // 16 max | 36 | uint8_t row : 4; // 16 max |
| 39 | uint8_t col:4; // 16 max | 37 | uint8_t col : 4; // 16 max |
| 40 | }; | 38 | }; |
| 41 | } matrix_co; | 39 | } matrix_co; |
| 42 | Point point; | 40 | Point point; |
| 43 | uint8_t modifier:1; | 41 | uint8_t modifier : 1; |
| 44 | } __attribute__((packed)) led_matrix; | 42 | } __attribute__((packed)) led_matrix; |
| 45 | 43 | ||
| 46 | extern const led_matrix g_leds[LED_DRIVER_LED_COUNT]; | 44 | extern const led_matrix g_leds[LED_DRIVER_LED_COUNT]; |
| 47 | 45 | ||
| 48 | typedef struct { | 46 | typedef struct { |
| 49 | uint8_t index; | 47 | uint8_t index; |
| 50 | uint8_t value; | 48 | uint8_t value; |
| 51 | } led_indicator; | 49 | } led_indicator; |
| 52 | 50 | ||
| 53 | typedef union { | 51 | typedef union { |
| 54 | uint32_t raw; | 52 | uint32_t raw; |
| 55 | struct { | 53 | struct { |
| 56 | bool enable :1; | 54 | bool enable : 1; |
| 57 | uint8_t mode :6; | 55 | uint8_t mode : 6; |
| 58 | uint8_t hue :8; // Unused by led_matrix | 56 | uint8_t hue : 8; // Unused by led_matrix |
| 59 | uint8_t sat :8; // Unused by led_matrix | 57 | uint8_t sat : 8; // Unused by led_matrix |
| 60 | uint8_t val :8; | 58 | uint8_t val : 8; |
| 61 | uint8_t speed :8;//EECONFIG needs to be increased to support this | 59 | uint8_t speed : 8; // EECONFIG needs to be increased to support this |
| 62 | }; | 60 | }; |
| 63 | } led_config_t; | 61 | } led_config_t; |
| 64 | 62 | ||
| 65 | enum led_matrix_effects { | 63 | enum led_matrix_effects { |
| @@ -95,22 +93,22 @@ bool process_led_matrix(uint16_t keycode, keyrecord_t *record); | |||
| 95 | 93 | ||
| 96 | uint32_t led_matrix_get_tick(void); | 94 | uint32_t led_matrix_get_tick(void); |
| 97 | 95 | ||
| 98 | void led_matrix_toggle(void); | 96 | void led_matrix_toggle(void); |
| 99 | void led_matrix_enable(void); | 97 | void led_matrix_enable(void); |
| 100 | void led_matrix_enable_noeeprom(void); | 98 | void led_matrix_enable_noeeprom(void); |
| 101 | void led_matrix_disable(void); | 99 | void led_matrix_disable(void); |
| 102 | void led_matrix_disable_noeeprom(void); | 100 | void led_matrix_disable_noeeprom(void); |
| 103 | void led_matrix_step(void); | 101 | void led_matrix_step(void); |
| 104 | void led_matrix_step_reverse(void); | 102 | void led_matrix_step_reverse(void); |
| 105 | void led_matrix_increase_val(void); | 103 | void led_matrix_increase_val(void); |
| 106 | void led_matrix_decrease_val(void); | 104 | void led_matrix_decrease_val(void); |
| 107 | void led_matrix_increase_speed(void); | 105 | void led_matrix_increase_speed(void); |
| 108 | void led_matrix_decrease_speed(void); | 106 | void led_matrix_decrease_speed(void); |
| 109 | void led_matrix_mode(uint8_t mode, bool eeprom_write); | 107 | void led_matrix_mode(uint8_t mode, bool eeprom_write); |
| 110 | void led_matrix_mode_noeeprom(uint8_t mode); | 108 | void led_matrix_mode_noeeprom(uint8_t mode); |
| 111 | uint8_t led_matrix_get_mode(void); | 109 | uint8_t led_matrix_get_mode(void); |
| 112 | void led_matrix_set_value(uint8_t mode); | 110 | void led_matrix_set_value(uint8_t mode); |
| 113 | void led_matrix_set_value_noeeprom(uint8_t mode); | 111 | void led_matrix_set_value_noeeprom(uint8_t mode); |
| 114 | 112 | ||
| 115 | typedef struct { | 113 | typedef struct { |
| 116 | /* Perform any initialisation required for the other driver functions to work. */ | 114 | /* Perform any initialisation required for the other driver functions to work. */ |
