aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2021-12-23 16:38:53 -0800
committerGitHub <noreply@github.com>2021-12-23 16:38:53 -0800
commitdb149052c3067553fa357d0590ed0f9fc4460f40 (patch)
treed4124c8c58b97e49703bfc4c3a8fac32da6c803e
parentd563ab052e694b5fd43de6c416589877df040576 (diff)
downloadqmk_firmware-db149052c3067553fa357d0590ed0f9fc4460f40.tar.gz
qmk_firmware-db149052c3067553fa357d0590ed0f9fc4460f40.zip
[Keyboard] Fix compilation issues for Pearlboards (#15562)
-rw-r--r--keyboards/pearlboards/pandora/pandora.c14
-rw-r--r--keyboards/pearlboards/zeus/zeus.c8
-rw-r--r--keyboards/pearlboards/zeuspad/zeuspad.c60
3 files changed, 52 insertions, 30 deletions
diff --git a/keyboards/pearlboards/pandora/pandora.c b/keyboards/pearlboards/pandora/pandora.c
index 5ce5d22b0..608ee00ed 100644
--- a/keyboards/pearlboards/pandora/pandora.c
+++ b/keyboards/pearlboards/pandora/pandora.c
@@ -17,7 +17,11 @@
17#include "pandora.h" 17#include "pandora.h"
18 18
19// Encoder rotate function 19// Encoder rotate function
20bool encoder_update_user(uint8_t index, bool clockwise) { 20#ifdef ENCODER_ENABLE
21bool encoder_update_kb(uint8_t index, bool clockwise) {
22 if (!encoder_update_user(index, clockwise)) {
23 return false;
24 }
21 /* First encoder */ 25 /* First encoder */
22 if (index == 0) { 26 if (index == 0) {
23 if (clockwise) { 27 if (clockwise) {
@@ -28,8 +32,13 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
28 } 32 }
29 return true; 33 return true;
30} 34}
35#endif
36
31// Encoder click function 37// Encoder click function
32bool dip_switch_update_user(uint8_t index, bool active) { 38#ifdef DIP_SWITCH_ENABLE
39bool dip_switch_update_kb(uint8_t index, bool active) {
40 if (!dip_switch_update_user(index, active)) { return false; }
41
33 switch (index) { 42 switch (index) {
34 /* First encoder */ 43 /* First encoder */
35 case 0: 44 case 0:
@@ -40,3 +49,4 @@ bool dip_switch_update_user(uint8_t index, bool active) {
40 } 49 }
41 return true; 50 return true;
42} 51}
52#endif
diff --git a/keyboards/pearlboards/zeus/zeus.c b/keyboards/pearlboards/zeus/zeus.c
index 42b77b283..cdb8d6125 100644
--- a/keyboards/pearlboards/zeus/zeus.c
+++ b/keyboards/pearlboards/zeus/zeus.c
@@ -17,8 +17,11 @@
17#include "zeus.h" 17#include "zeus.h"
18 18
19// Encoder rotate function 19// Encoder rotate function
20bool encoder_update_user(uint8_t index, bool clockwise) { 20#ifdef ENCODER_ENABLE
21 /* First encoder */ 21bool encoder_update_kb(uint8_t index, bool clockwise) {
22 if (!encoder_update_user(index, clockwise)) {
23 return false;
24 } /* First encoder */
22 if (index == 0) { 25 if (index == 0) {
23 if (clockwise) { 26 if (clockwise) {
24 tap_code(KC_AUDIO_VOL_UP); 27 tap_code(KC_AUDIO_VOL_UP);
@@ -28,3 +31,4 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
28 } 31 }
29 return true; 32 return true;
30} 33}
34#endif
diff --git a/keyboards/pearlboards/zeuspad/zeuspad.c b/keyboards/pearlboards/zeuspad/zeuspad.c
index fd79058e8..3f7367fb4 100644
--- a/keyboards/pearlboards/zeuspad/zeuspad.c
+++ b/keyboards/pearlboards/zeuspad/zeuspad.c
@@ -17,31 +17,39 @@
17#include "zeuspad.h" 17#include "zeuspad.h"
18 18
19// Encoder rotate function 19// Encoder rotate function
20bool encoder_update_user(uint8_t index, bool clockwise) { 20#ifdef ENCODER_ENABLE
21bool encoder_update_kb(uint8_t index, bool clockwise) {
22 if (!encoder_update_user(index, clockwise)) {
23 return false;
24 }
21 /* First encoder */ 25 /* First encoder */
22 if (index == 0) { 26 if (index == 0) {
23 if (clockwise) { 27 if (clockwise) {
24 tap_code(KC_AUDIO_VOL_UP); 28 tap_code_delay(KC_AUDIO_VOL_UP, 10);
25 } else { 29 } else {
26 tap_code(KC_AUDIO_VOL_DOWN); 30 tap_code_delay(KC_AUDIO_VOL_DOWN, 10);
27 } 31 }
28 } 32 }
29 return true; 33 return true;
30} 34}
35#endif
31 36
32//21 characters max 37// 21 characters max
33#ifdef OLED_ENABLE 38#ifdef OLED_ENABLE
34void oled_task_user(void) { 39bool oled_task_kb(void) {
35 oled_write_P(PSTR("ZEUSPAD BY KOOBACZECH"), false); 40 if (oled_task_user()) {
36 // Keyboard Layer Status 41 return false;
37 oled_write_P(PSTR("LAYER: "), false); 42 }
43 oled_write_P(PSTR("ZEUSPAD BY KOOBACZECH"), false);
44 // Keyboard Layer Status
45 oled_write_P(PSTR("LAYER: "), false);
38 46
39 switch (get_highest_layer(layer_state)) { 47 switch (get_highest_layer(layer_state)) {
40 case 1: 48 case 1:
41 oled_write_ln_P(PSTR("FN"), false); 49 oled_write_ln_P(PSTR("FN"), false);
42 break; 50 break;
43 default: 51 default:
44 oled_write_ln_P(PSTR("Default"), false); 52 oled_write_ln_P(PSTR("Default"), false);
45 } 53 }
46 // Keyboard Locking Status 54 // Keyboard Locking Status
47 led_t led_state = host_keyboard_led_state(); 55 led_t led_state = host_keyboard_led_state();
@@ -50,18 +58,18 @@ void oled_task_user(void) {
50 oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); 58 oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
51 59
52 switch (rgblight_is_enabled() ? 1 : 2) { 60 switch (rgblight_is_enabled() ? 1 : 2) {
53 case 1: 61 case 1:
54 // Or use the write_ln shortcut over adding '\n' to the end of your string 62 // Or use the write_ln shortcut over adding '\n' to the end of your string
55 oled_write_P(PSTR("RGB"), false); 63 oled_write_P(PSTR("RGB"), false);
56 static char led_buf[30]; 64 static char led_buf[30];
57 snprintf(led_buf, sizeof(led_buf) - 1, "\nMODE:%2d BRIGHT:%2d/10", 65 snprintf(led_buf, sizeof(led_buf) - 1, "\nMODE:%2d BRIGHT:%2d/10", (uint8_t)(rgblight_get_mode()), (uint8_t)(rgblight_get_val() / 25.5));
58 (uint8_t)(rgblight_get_mode()), 66 oled_write(led_buf, false);
59 (uint8_t)(rgblight_get_val()/25.5)); 67 break;
60 oled_write(led_buf, false); 68 default:
61 break; 69 oled_write_ln_P(PSTR(""), false);
62 default: 70 oled_write_P(PSTR("\n"), false);
63 oled_write_ln_P(PSTR(""), false);
64 oled_write_P(PSTR("\n"), false);
65 } 71 }
72
73 return true;
66} 74}
67#endif 75#endif