Move all struct type definitions to the top

This commit is contained in:
Richard Sailer 2019-08-18 06:03:47 +02:00
parent efe641bb42
commit 6c80892b31

View file

@ -89,6 +89,28 @@ struct color_list_t color_list = {
} }
}; };
// Keyboard struct
struct kbd_led_state_t {
u8 has_extra;
u8 state;
struct {
u32 left;
u32 center;
u32 right;
u32 extra;
} color;
u8 brightness;
u8 blinking_pattern;
};
struct blinking_pattern {
u8 key;
u32 value;
const char *const name;
};
#define KB_COLOR_DEFAULT COLOR_WHITE // Default Color White #define KB_COLOR_DEFAULT COLOR_WHITE // Default Color White
@ -157,22 +179,6 @@ module_param_named(state, param_state, bool, S_IRUSR);
MODULE_PARM_DESC(state, MODULE_PARM_DESC(state,
"Set the State of the Keyboard TRUE = ON | FALSE = OFF"); "Set the State of the Keyboard TRUE = ON | FALSE = OFF");
// Keyboard struct
struct kbd_led_state_t {
u8 has_extra;
u8 state;
struct {
u32 left;
u32 center;
u32 right;
u32 extra;
} color;
u8 brightness;
u8 blinking_pattern;
};
static struct kbd_led_state_t kbd_led_state = { static struct kbd_led_state_t kbd_led_state = {
.has_extra = 0, .has_extra = 0,
.state = 1, .state = 1,
@ -184,12 +190,6 @@ static struct kbd_led_state_t kbd_led_state = {
.blinking_pattern = DEFAULT_BLINKING_PATTERN .blinking_pattern = DEFAULT_BLINKING_PATTERN
}; };
struct blinking_pattern {
u8 key;
u32 value;
const char *const name;
};
static struct blinking_pattern blinking_patterns[] = { static struct blinking_pattern 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"},