|
|
|
@ -17,21 +17,29 @@ |
|
|
|
|
#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
|
|
|
|
|
#ifdef OLED_ENABLE |
|
|
|
|
void oled_task_user(void) { |
|
|
|
|
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); |
|
|
|
@ -54,14 +62,14 @@ void oled_task_user(void) { |
|
|
|
|
// 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)); |
|
|
|
|
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 |
|
|
|
|