1
0
Fork 0

Update my code to use layer_state_t typedef

This commit is contained in:
Drashna Jaelre 2019-05-17 15:21:45 -07:00
parent 356521864e
commit 89e9785d7a
No known key found for this signature in database
GPG key ID: 4C4221222CD5F9F0
6 changed files with 12 additions and 12 deletions

View file

@ -319,7 +319,7 @@ void dip_update(uint8_t index, bool active) {
#endif // KEYBOARD_planck_rev6 #endif // KEYBOARD_planck_rev6
#ifdef KEYBOARD_planck_ez #ifdef KEYBOARD_planck_ez
uint32_t layer_state_set_keymap(uint32_t state) { layer_state_t layer_state_set_keymap(layer_state_t state) {
palClearPad(GPIOB, 8); palClearPad(GPIOB, 8);
palClearPad(GPIOB, 9); palClearPad(GPIOB, 9);

View file

@ -187,13 +187,13 @@ void matrix_scan_user(void) {
__attribute__ ((weak)) __attribute__ ((weak))
uint32_t layer_state_set_keymap (uint32_t state) { layer_state_t layer_state_set_keymap (layer_state_t state) {
return state; return state;
} }
// on layer change, no matter where the change was initiated // on layer change, no matter where the change was initiated
// Then runs keymap's layer change check // Then runs keymap's layer change check
uint32_t layer_state_set_user(uint32_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
#ifdef RGBLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE
state = layer_state_set_rgb(state); state = layer_state_set_rgb(state);
@ -203,12 +203,12 @@ uint32_t layer_state_set_user(uint32_t state) {
__attribute__ ((weak)) __attribute__ ((weak))
uint32_t default_layer_state_set_keymap (uint32_t state) { layer_state_t default_layer_state_set_keymap (layer_state_t state) {
return state; return state;
} }
// Runs state check and changes underglow color and animation // Runs state check and changes underglow color and animation
uint32_t default_layer_state_set_user(uint32_t state) { layer_state_t default_layer_state_set_user(layer_state_t state) {
state = default_layer_state_set_keymap(state); state = default_layer_state_set_keymap(state);
#if 0 #if 0
#ifdef RGBLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE

View file

@ -67,8 +67,8 @@ void shutdown_keymap(void);
void suspend_power_down_keymap(void); void suspend_power_down_keymap(void);
void suspend_wakeup_init_keymap(void); void suspend_wakeup_init_keymap(void);
void matrix_scan_keymap(void); void matrix_scan_keymap(void);
uint32_t layer_state_set_keymap (uint32_t state); layer_state_t layer_state_set_keymap (layer_state_t state);
uint32_t default_layer_state_set_keymap (uint32_t state); layer_state_t default_layer_state_set_keymap (layer_state_t state);
void led_set_keymap(uint8_t usb_led); void led_set_keymap(uint8_t usb_led);
void eeconfig_init_keymap(void); void eeconfig_init_keymap(void);

View file

@ -275,7 +275,7 @@ void matrix_scan_rgb(void) {
} }
uint32_t layer_state_set_rgb(uint32_t state) { layer_state_t layer_state_set_rgb(layer_state_t state) {
#ifdef RGBLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE
if (userspace_config.rgb_layer_change) { if (userspace_config.rgb_layer_change) {
switch (biton32(state)) { switch (biton32(state)) {

View file

@ -15,8 +15,8 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record);
void scan_rgblight_fadeout(void); void scan_rgblight_fadeout(void);
void keyboard_post_init_rgb(void); void keyboard_post_init_rgb(void);
void matrix_scan_rgb(void); void matrix_scan_rgb(void);
uint32_t layer_state_set_rgb(uint32_t state); layer_state_t layer_state_set_rgb(layer_state_t state);
uint32_t default_layer_state_set_rgb(uint32_t state); layer_state_t default_layer_state_set_rgb(layer_state_t state);
void rgblight_sethsv_default_helper(uint8_t index); void rgblight_sethsv_default_helper(uint8_t index);
void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ); void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue );

View file

@ -62,11 +62,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
__attribute__ ((weak)) __attribute__ ((weak))
uint32_t layer_state_set_keymap (uint32_t state) { layer_state_t layer_state_set_keymap (layer_state_t state) {
return state; return state;
} }
uint32_t layer_state_set_user (uint32_t state) { layer_state_t layer_state_set_user (layer_state_t state) {
return layer_state_set_keymap (state); return layer_state_set_keymap (state);
} }