diff options
author | QMK Bot <hello@qmk.fm> | 2021-12-24 00:39:31 +0000 |
---|---|---|
committer | QMK Bot <hello@qmk.fm> | 2021-12-24 00:39:31 +0000 |
commit | 45731efcac7ef68e0844e126b17bc701cb4a6e5d (patch) | |
tree | de593cc29aec2c52e98b8a3f8b4c0c928a953ea0 /keyboards | |
parent | b7ed91f861c7aa7efd2138e9cca664f94bcffa8e (diff) | |
parent | db149052c3067553fa357d0590ed0f9fc4460f40 (diff) |
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'keyboards')
-rw-r--r-- | keyboards/pearlboards/pandora/pandora.c | 14 | ||||
-rw-r--r-- | keyboards/pearlboards/zeus/zeus.c | 8 | ||||
-rw-r--r-- | keyboards/pearlboards/zeuspad/zeuspad.c | 60 |
3 files changed, 52 insertions, 30 deletions
diff --git a/keyboards/pearlboards/pandora/pandora.c b/keyboards/pearlboards/pandora/pandora.c index 5ce5d22b06..608ee00edf 100644 --- a/keyboards/pearlboards/pandora/pandora.c +++ b/keyboards/pearlboards/pandora/pandora.c @@ -17,7 +17,11 @@ #include "pandora.h" // Encoder rotate function -bool encoder_update_user(uint8_t index, bool clockwise) { +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { + return false; + } /* First encoder */ if (index == 0) { if (clockwise) { @@ -28,8 +32,13 @@ bool encoder_update_user(uint8_t index, bool clockwise) { } return true; } +#endif + // Encoder click function -bool dip_switch_update_user(uint8_t index, bool active) { +#ifdef DIP_SWITCH_ENABLE +bool dip_switch_update_kb(uint8_t index, bool active) { + if (!dip_switch_update_user(index, active)) { return false; } + switch (index) { /* First encoder */ case 0: @@ -40,3 +49,4 @@ bool dip_switch_update_user(uint8_t index, bool active) { } return true; } +#endif diff --git a/keyboards/pearlboards/zeus/zeus.c b/keyboards/pearlboards/zeus/zeus.c index 42b77b2831..cdb8d6125d 100644 --- a/keyboards/pearlboards/zeus/zeus.c +++ b/keyboards/pearlboards/zeus/zeus.c @@ -17,8 +17,11 @@ #include "zeus.h" // Encoder rotate function -bool encoder_update_user(uint8_t index, bool clockwise) { - /* First encoder */ +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { + return false; + } /* First encoder */ if (index == 0) { if (clockwise) { tap_code(KC_AUDIO_VOL_UP); @@ -28,3 +31,4 @@ bool encoder_update_user(uint8_t index, bool clockwise) { } return true; } +#endif diff --git a/keyboards/pearlboards/zeuspad/zeuspad.c b/keyboards/pearlboards/zeuspad/zeuspad.c index fd79058e85..3f7367fb49 100644 --- a/keyboards/pearlboards/zeuspad/zeuspad.c +++ b/keyboards/pearlboards/zeuspad/zeuspad.c @@ -17,31 +17,39 @@ #include "zeuspad.h" // Encoder rotate function -bool encoder_update_user(uint8_t index, bool clockwise) { +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { + return false; + } /* First encoder */ if (index == 0) { if (clockwise) { - tap_code(KC_AUDIO_VOL_UP); + tap_code_delay(KC_AUDIO_VOL_UP, 10); } else { - tap_code(KC_AUDIO_VOL_DOWN); + tap_code_delay(KC_AUDIO_VOL_DOWN, 10); } } return true; } +#endif -//21 characters max +// 21 characters max #ifdef OLED_ENABLE -void oled_task_user(void) { - oled_write_P(PSTR("ZEUSPAD BY KOOBACZECH"), false); - // Keyboard Layer Status - oled_write_P(PSTR("LAYER: "), false); +bool oled_task_kb(void) { + if (oled_task_user()) { + return false; + } + oled_write_P(PSTR("ZEUSPAD BY KOOBACZECH"), false); + // Keyboard Layer Status + oled_write_P(PSTR("LAYER: "), false); - switch (get_highest_layer(layer_state)) { - case 1: - oled_write_ln_P(PSTR("FN"), false); - break; - default: - oled_write_ln_P(PSTR("Default"), false); + switch (get_highest_layer(layer_state)) { + case 1: + oled_write_ln_P(PSTR("FN"), false); + break; + default: + oled_write_ln_P(PSTR("Default"), false); } // Keyboard Locking Status led_t led_state = host_keyboard_led_state(); @@ -50,18 +58,18 @@ void oled_task_user(void) { oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); switch (rgblight_is_enabled() ? 1 : 2) { - case 1: - // Or use the write_ln shortcut over adding '\n' to the end of your string - oled_write_P(PSTR("RGB"), false); - static char led_buf[30]; - snprintf(led_buf, sizeof(led_buf) - 1, "\nMODE:%2d BRIGHT:%2d/10", - (uint8_t)(rgblight_get_mode()), - (uint8_t)(rgblight_get_val()/25.5)); - oled_write(led_buf, false); - break; - default: - oled_write_ln_P(PSTR(""), false); - oled_write_P(PSTR("\n"), false); + case 1: + // Or use the write_ln shortcut over adding '\n' to the end of your string + oled_write_P(PSTR("RGB"), false); + static char led_buf[30]; + snprintf(led_buf, sizeof(led_buf) - 1, "\nMODE:%2d BRIGHT:%2d/10", (uint8_t)(rgblight_get_mode()), (uint8_t)(rgblight_get_val() / 25.5)); + oled_write(led_buf, false); + break; + default: + oled_write_ln_P(PSTR(""), false); + oled_write_P(PSTR("\n"), false); } + + return true; } #endif |