Remove deprecated callbacks for encoders and dip switches (#13404)

This commit is contained in:
Drashna Jaelre 2021-07-24 00:37:19 -07:00 committed by GitHub
parent cbe1e52623
commit e147ee0079
2 changed files with 46 additions and 42 deletions

View file

@ -15,7 +15,7 @@
*/
#include QMK_KEYBOARD_H
// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_4x4(
KC_F1, KC_F2, KC_F3, KC_F4,
@ -36,6 +36,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, TO(0)
),
};
// clang-format on
layer_state_t layer_state_set_user(layer_state_t state) {
switch (get_highest_layer(state)) {
case 0:
@ -54,7 +56,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
return state;
}
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 */
/* And with another if statement we can check the direction. */
@ -69,4 +71,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_AUDIO_VOL_DOWN);
}
}
return true;
}

View file

@ -85,7 +85,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
return true;
}
// Encoder click function
void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
switch (index) {
/* First encoder */
case 0:
@ -94,4 +94,5 @@ void dip_switch_update_user(uint8_t index, bool active) {
}
break;
}
return true
}