Move color list to other global vars + make it static + add comments

This commit is contained in:
Richard Sailer 2019-08-18 06:28:06 +02:00
parent 690b43987a
commit 68eb899f71

View file

@ -75,20 +75,6 @@ struct color_list_t {
struct color_t colors[]; struct color_t colors[];
}; };
struct color_list_t color_list = {
.size = 8,
.colors = {
{ .name = "BLACK", .code = 0x000000 },
{ .name = "RED", .code = 0xFF0000 },
{ .name = "GREEN", .code = 0x00FF00 },
{ .name = "BLUE", .code = 0x0000FF },
{ .name = "YELLOW", .code = 0xFFFF00 },
{ .name = "MAGENTA", .code = 0xFF00FF },
{ .name = "CYAN", .code = 0x00FFFF },
{ .name = "WHITE", .code = 0xFFFFFF },
}
};
// Keyboard struct // Keyboard struct
struct kbd_led_state_t { struct kbd_led_state_t {
u8 has_extra; u8 has_extra;
@ -190,6 +176,20 @@ static struct kbd_led_state_t kbd_led_state = {
.blinking_pattern = DEFAULT_BLINKING_PATTERN .blinking_pattern = DEFAULT_BLINKING_PATTERN
}; };
static struct color_list_t color_list = {
.size = 8,
.colors = {
{ .name = "BLACK", .code = 0x000000 }, // 0
{ .name = "RED", .code = 0xFF0000 }, // 1
{ .name = "GREEN", .code = 0x00FF00 }, // 2
{ .name = "BLUE", .code = 0x0000FF }, // 3
{ .name = "YELLOW", .code = 0xFFFF00 }, // 4
{ .name = "MAGENTA", .code = 0xFF00FF }, // 5
{ .name = "CYAN", .code = 0x00FFFF }, // 6
{ .name = "WHITE", .code = 0xFFFFFF }, // 7
}
};
static struct blinking_pattern_t blinking_patterns[] = { static struct blinking_pattern_t blinking_patterns[] = {
{ .key = 0,.value = 0,.name = "CUSTOM"}, { .key = 0,.value = 0,.name = "CUSTOM"},
{ .key = 1,.value = 0x1002a000,.name = "BREATHE"}, { .key = 1,.value = 0x1002a000,.name = "BREATHE"},