aboutsummaryrefslogtreecommitdiff
path: root/keyboards/pearlboards/zeuspad/zeuspad.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/pearlboards/zeuspad/zeuspad.c')
-rw-r--r--keyboards/pearlboards/zeuspad/zeuspad.c60
1 files changed, 34 insertions, 26 deletions
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