Skip to content

Commit

Permalink
Fixed build errors in Tidbit firmware due to mismatched return type i…
Browse files Browse the repository at this point in the history
…n keymaps (#9)

* Fixed encoder_update return type mismatch in VIA keymap

* Fixed encoder_update return type mismatch in OLED keycap

* Fixed encoder_update return type mismatch in DEFAULT keycap

* Fixed encoder_update return type mismatch in 4ROTARY keymap

* Fixed encoder_update return type mismatch in 19KEYPAD keymap
  • Loading branch information
aashreys authored Jul 14, 2021
1 parent e891938 commit 09df2a0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
5 changes: 3 additions & 2 deletions keymaps/19keypad/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}

void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
return true;
}

layer_state_t layer_state_set_user(layer_state_t state) {
Expand All @@ -97,4 +98,4 @@ void led_set_kb(uint8_t usb_led) {
set_bitc_LED(LED_ON);
else
set_bitc_LED(LED_DIM);
}
}
3 changes: 2 additions & 1 deletion keymaps/4rotary/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}

void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
/* With an if statement we can check which encoder was turned. */
if (index == 0) { /* First encoder */
if (clockwise) {
Expand All @@ -114,6 +114,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_VOLD);
}
}
return true;
}

layer_state_t layer_state_set_user(layer_state_t state) {
Expand Down
7 changes: 4 additions & 3 deletions keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}

void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
}
return true;
}

layer_state_t layer_state_set_user(layer_state_t state) {
Expand All @@ -107,4 +108,4 @@ void led_set_kb(uint8_t usb_led) {
set_bitc_LED(LED_DIM);
else
set_bitc_LED(LED_OFF);
}
}
7 changes: 4 additions & 3 deletions keymaps/oled/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}

void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
}
return true;
}

layer_state_t layer_state_set_user(layer_state_t state) {
Expand All @@ -154,4 +155,4 @@ void led_set_kb(uint8_t usb_led) {
set_bitc_LED(LED_DIM);
else
set_bitc_LED(LED_OFF);
}
}
7 changes: 4 additions & 3 deletions keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,18 @@ void matrix_scan_user(void) {
matrix_scan_remote_kb();
}

void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
}
return true;
}

void led_set_kb(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_NUM_LOCK))
set_bitc_LED(LED_DIM);
else
set_bitc_LED(LED_OFF);
}
}

0 comments on commit 09df2a0

Please sign in to comment.