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/color.h | |
| parent | 61af76a10d00aba185b8338604171de490a13e3b (diff) | |
| download | qmk_firmware-b624f32f944acdc59dcb130674c09090c5c404cb.tar.gz qmk_firmware-b624f32f944acdc59dcb130674c09090c5c404cb.zip | |
clang-format changes
Diffstat (limited to 'quantum/color.h')
| -rw-r--r-- | quantum/color.h | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/quantum/color.h b/quantum/color.h index 22bb08351..678164662 100644 --- a/quantum/color.h +++ b/quantum/color.h | |||
| @@ -14,60 +14,55 @@ | |||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | |||
| 18 | #ifndef COLOR_H | 17 | #ifndef COLOR_H |
| 19 | #define COLOR_H | 18 | #define COLOR_H |
| 20 | 19 | ||
| 21 | #include <stdint.h> | 20 | #include <stdint.h> |
| 22 | #include <stdbool.h> | 21 | #include <stdbool.h> |
| 23 | 22 | ||
| 24 | |||
| 25 | #if defined(__GNUC__) | 23 | #if defined(__GNUC__) |
| 26 | #define PACKED __attribute__ ((__packed__)) | 24 | # define PACKED __attribute__((__packed__)) |
| 27 | #else | 25 | #else |
| 28 | #define PACKED | 26 | # define PACKED |
| 29 | #endif | 27 | #endif |
| 30 | 28 | ||
| 31 | #if defined(_MSC_VER) | 29 | #if defined(_MSC_VER) |
| 32 | #pragma pack( push, 1 ) | 30 | # pragma pack(push, 1) |
| 33 | #endif | 31 | #endif |
| 34 | 32 | ||
| 35 | #ifdef RGBW | 33 | #ifdef RGBW |
| 36 | #define LED_TYPE cRGBW | 34 | # define LED_TYPE cRGBW |
| 37 | #else | 35 | #else |
| 38 | #define LED_TYPE RGB | 36 | # define LED_TYPE RGB |
| 39 | #endif | 37 | #endif |
| 40 | 38 | ||
| 41 | // WS2812 specific layout | 39 | // WS2812 specific layout |
| 42 | typedef struct PACKED | 40 | typedef struct PACKED { |
| 43 | { | 41 | uint8_t g; |
| 44 | uint8_t g; | 42 | uint8_t r; |
| 45 | uint8_t r; | 43 | uint8_t b; |
| 46 | uint8_t b; | ||
| 47 | } cRGB; | 44 | } cRGB; |
| 48 | 45 | ||
| 49 | typedef cRGB RGB; | 46 | typedef cRGB RGB; |
| 50 | 47 | ||
| 51 | // WS2812 specific layout | 48 | // WS2812 specific layout |
| 52 | typedef struct PACKED | 49 | typedef struct PACKED { |
| 53 | { | 50 | uint8_t g; |
| 54 | uint8_t g; | 51 | uint8_t r; |
| 55 | uint8_t r; | 52 | uint8_t b; |
| 56 | uint8_t b; | 53 | uint8_t w; |
| 57 | uint8_t w; | ||
| 58 | } cRGBW; | 54 | } cRGBW; |
| 59 | 55 | ||
| 60 | typedef struct PACKED | 56 | typedef struct PACKED { |
| 61 | { | 57 | uint8_t h; |
| 62 | uint8_t h; | 58 | uint8_t s; |
| 63 | uint8_t s; | 59 | uint8_t v; |
| 64 | uint8_t v; | ||
| 65 | } HSV; | 60 | } HSV; |
| 66 | 61 | ||
| 67 | #if defined(_MSC_VER) | 62 | #if defined(_MSC_VER) |
| 68 | #pragma pack( pop ) | 63 | # pragma pack(pop) |
| 69 | #endif | 64 | #endif |
| 70 | 65 | ||
| 71 | RGB hsv_to_rgb(HSV hsv); | 66 | RGB hsv_to_rgb(HSV hsv); |
| 72 | 67 | ||
| 73 | #endif // COLOR_H | 68 | #endif // COLOR_H |
