[Core] Change OLED task function to be boolean (#14864)
* [Core] Add kb level callbacks to OLED driver * Update keyboards and keymaps * Update docs * Update userspace configs * Add fix for my keymap ... * update lefty
This commit is contained in:
parent
f775da96b1
commit
9d235d4fc5
@ -38,7 +38,7 @@ Then in your `keymap.c` file, implement the OLED task call. This example assumes
|
||||
|
||||
```c
|
||||
#ifdef OLED_ENABLE
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
// Host Keyboard Layer Status
|
||||
oled_write_P(PSTR("Layer: "), false);
|
||||
|
||||
@ -62,6 +62,8 @@ void oled_task_user(void) {
|
||||
oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
|
||||
oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
|
||||
oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
```
|
||||
@ -133,13 +135,14 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return rotation;
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
|
||||
} else {
|
||||
render_logo(); // Renders a static logo
|
||||
oled_scroll_left(); // Turns on scrolling
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
```
|
||||
@ -237,6 +240,7 @@ bool oled_init(oled_rotation_t rotation);
|
||||
// Called at the start of oled_init, weak function overridable by the user
|
||||
// rotation - the value passed into oled_init
|
||||
// Return new oled_rotation_t if you want to override default rotation
|
||||
oled_rotation_t oled_init_kb(oled_rotation_t rotation);
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation);
|
||||
|
||||
// Clears the display buffer, resets cursor position to 0, and sets the buffer to dirty for rendering
|
||||
@ -328,7 +332,8 @@ uint8_t oled_get_brightness(void);
|
||||
void oled_task(void);
|
||||
|
||||
// Called at the start of oled_task, weak function overridable by the user
|
||||
void oled_task_user(void);
|
||||
bool oled_task_kb(void);
|
||||
bool oled_task_user(void);
|
||||
|
||||
// Set the specific 8 lines rows of the screen to scroll.
|
||||
// 0 is the default for start, and 7 for end, which is the entire
|
||||
|
@ -190,6 +190,7 @@ bool oled_init(oled_rotation_t rotation);
|
||||
// Called at the start of oled_init, weak function overridable by the user
|
||||
// rotation - the value passed into oled_init
|
||||
// Return new oled_rotation_t if you want to override default rotation
|
||||
oled_rotation_t oled_init_kb(oled_rotation_t rotation);
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation);
|
||||
|
||||
// Clears the display buffer, resets cursor position to 0, and sets the buffer to dirty for rendering
|
||||
@ -285,7 +286,8 @@ uint8_t oled_get_brightness(void);
|
||||
void oled_task(void);
|
||||
|
||||
// Called at the start of oled_task, weak function overridable by the user
|
||||
void oled_task_user(void);
|
||||
bool oled_task_kb(void);
|
||||
bool oled_task_user(void);
|
||||
|
||||
// Set the specific 8 lines rows of the screen to scroll.
|
||||
// 0 is the default for start, and 7 for end, which is the entire
|
||||
|
@ -167,7 +167,7 @@ bool oled_init(oled_rotation_t rotation) {
|
||||
}
|
||||
#endif
|
||||
|
||||
oled_rotation = oled_init_user(rotation);
|
||||
oled_rotation = oled_init_user(oled_init_kb(rotation));
|
||||
if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) {
|
||||
oled_rotation_width = OLED_DISPLAY_WIDTH;
|
||||
} else {
|
||||
@ -232,6 +232,7 @@ bool oled_init(oled_rotation_t rotation) {
|
||||
return true;
|
||||
}
|
||||
|
||||
__attribute__((weak)) oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return rotation; }
|
||||
__attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) { return rotation; }
|
||||
|
||||
void oled_clear(void) {
|
||||
@ -741,11 +742,11 @@ void oled_task(void) {
|
||||
if (timer_elapsed(oled_update_timeout) >= OLED_UPDATE_INTERVAL) {
|
||||
oled_update_timeout = timer_read();
|
||||
oled_set_cursor(0, 0);
|
||||
oled_task_user();
|
||||
oled_task_kb();
|
||||
}
|
||||
#else
|
||||
oled_set_cursor(0, 0);
|
||||
oled_task_user();
|
||||
oled_task_kb();
|
||||
#endif
|
||||
|
||||
#if OLED_SCROLL_TIMEOUT > 0
|
||||
@ -776,4 +777,5 @@ void oled_task(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
__attribute__((weak)) void oled_task_user(void) {}
|
||||
__attribute__((weak)) bool oled_task_kb(void) { return oled_task_user(); }
|
||||
__attribute__((weak)) bool oled_task_user(void) { return true; }
|
||||
|
@ -168,7 +168,7 @@ static void render_rgbled_status(bool) {
|
||||
oled_write_ln_P(PSTR("\n"), false);
|
||||
}
|
||||
}
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
static bool finished_timer = false;
|
||||
if (!finished_timer && (timer_elapsed(startup_timer) < 1000)) {
|
||||
render_logo();
|
||||
@ -181,5 +181,6 @@ void oled_task_user(void) {
|
||||
render_rgbled_status(true);
|
||||
render_logo_font();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -159,7 +159,7 @@ static void render_rgbled_status(void) {
|
||||
oled_write_ln_P(PSTR("\n"), false);
|
||||
}
|
||||
}
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
static bool finished_timer = false;
|
||||
if (!finished_timer && (timer_elapsed(startup_timer) < 1000)) {
|
||||
render_logo();
|
||||
@ -172,5 +172,6 @@ void oled_task_user(void) {
|
||||
render_rgbled_status();
|
||||
render_logo_font();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -168,7 +168,7 @@ static void render_rgbled_status(bool) {
|
||||
oled_write_ln_P(PSTR("\n"), false);
|
||||
}
|
||||
}
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
static bool finished_timer = false;
|
||||
if (!finished_timer && (timer_elapsed(startup_timer) < 1000)) {
|
||||
render_logo();
|
||||
@ -181,5 +181,6 @@ void oled_task_user(void) {
|
||||
render_rgbled_status(true);
|
||||
render_logo_font();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -168,7 +168,7 @@ static void render_rgbled_status(void) {
|
||||
oled_write_ln_P(PSTR("\n"), false);
|
||||
}
|
||||
}
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
static bool finished_timer = false;
|
||||
if (!finished_timer && (timer_elapsed(startup_timer) < 1000)) {
|
||||
render_logo();
|
||||
@ -181,5 +181,6 @@ void oled_task_user(void) {
|
||||
render_rgbled_status();
|
||||
render_logo_font();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -262,7 +262,7 @@ static void render_cat(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
static bool finished_timer = false;
|
||||
if (!finished_timer && (timer_elapsed(startup_timer) < 3000)) {
|
||||
render_logo();
|
||||
@ -286,6 +286,7 @@ void oled_task_user(void) {
|
||||
render_layer();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -175,7 +175,7 @@ static void render_layer(void) {
|
||||
oled_write_P(logo[3][2], false);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
static bool finished_timer = false;
|
||||
if (!finished_timer && (timer_elapsed(startup_timer) < 3000)) {
|
||||
render_logo();
|
||||
@ -186,5 +186,6 @@ void oled_task_user(void) {
|
||||
}
|
||||
render_layer();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -175,7 +175,7 @@ static void render_layer(void) {
|
||||
oled_write_P(logo[3][2], false);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
static bool finished_timer = false;
|
||||
if (!finished_timer && (timer_elapsed(startup_timer) < 3000)) {
|
||||
render_logo();
|
||||
@ -186,6 +186,7 @@ void oled_task_user(void) {
|
||||
}
|
||||
render_layer();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -55,7 +55,10 @@ static void render_logo(void) {
|
||||
}
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
void oled_task_user(void) { render_logo(); }
|
||||
bool oled_task_user(void) {
|
||||
render_logo();
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
|
@ -55,7 +55,10 @@ static void render_logo(void) {
|
||||
}
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
void oled_task_user(void) { render_logo(); }
|
||||
bool oled_task_user(void) {
|
||||
render_logo();
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
|
@ -89,10 +89,11 @@ void render_mod_status(uint8_t modifiers) {
|
||||
oled_write_ln(PSTR(" "), false);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
render_layer_state();
|
||||
render_keylock_status(host_keyboard_led_state());
|
||||
render_mod_status(get_mods()|get_oneshot_mods());
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -89,10 +89,11 @@ void render_mod_status(uint8_t modifiers) {
|
||||
oled_write_ln(PSTR(" "), false);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
render_layer_state();
|
||||
render_keylock_status(host_keyboard_led_state());
|
||||
render_mod_status(get_mods()|get_oneshot_mods());
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -9,7 +9,7 @@ void board_init(void) {
|
||||
SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_SPI2_DMA_RMP);
|
||||
}
|
||||
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
|
||||
return OLED_ROTATION_90; // rotates the display 90 degrees
|
||||
}
|
||||
|
||||
|
@ -135,12 +135,13 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return rotation;
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
print_status_narrow();
|
||||
} else {
|
||||
render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -138,12 +138,13 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return rotation;
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
print_status_narrow();
|
||||
} else {
|
||||
render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -67,12 +67,13 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return rotation;
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
print_status_narrow();
|
||||
} else {
|
||||
render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -22,7 +22,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
// Host Keyboard Layer Status
|
||||
oled_write_ln_P(PSTR("ANAVI Macro Pad 8"), false);
|
||||
oled_write_P(PSTR("Active layer: "), false);
|
||||
@ -57,5 +57,6 @@ void oled_task_user(void) {
|
||||
snprintf(rgbStatusLine2, sizeof(rgbStatusLine2), "h:%d s:%d v:%d", rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val());
|
||||
oled_write_ln(rgbStatusLine2, false);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -105,7 +105,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
// Host Keyboard Layer Status
|
||||
oled_write_ln_P(PSTR("ANAVI Macro Pad 8"), false);
|
||||
oled_write_P(PSTR("Active layer: "), false);
|
||||
@ -140,5 +140,6 @@ void oled_task_user(void) {
|
||||
snprintf(rgbStatusLine2, sizeof(rgbStatusLine2), "h:%d s:%d v:%d", rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val());
|
||||
oled_write_ln(rgbStatusLine2, false);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -75,7 +75,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
// Host Keyboard Layer Status
|
||||
oled_write_ln_P(PSTR("ANAVI Macro Pad 8"), false);
|
||||
oled_write_P(PSTR("Layer: "), false);
|
||||
@ -113,5 +113,6 @@ void oled_task_user(void) {
|
||||
snprintf(rgbStatusLine2, sizeof(rgbStatusLine2), "h:%d s:%d v:%d", rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val());
|
||||
oled_write_ln(rgbStatusLine2, false);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -41,7 +41,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
// Host Keyboard Layer Status
|
||||
oled_write_ln_P(PSTR("ANAVI Macro Pad 8"), false);
|
||||
oled_write_P(PSTR("Active layer: "), false);
|
||||
@ -76,5 +76,6 @@ void oled_task_user(void) {
|
||||
snprintf(rgbStatusLine2, sizeof(rgbStatusLine2), "h:%d s:%d v:%d", rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val());
|
||||
oled_write_ln(rgbStatusLine2, false);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -58,7 +58,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
// Host Keyboard Layer Status
|
||||
oled_write_ln_P(PSTR("ANAVI Macro Pad 8"), false);
|
||||
oled_write_P(PSTR("Active layer: "), false);
|
||||
@ -93,5 +93,6 @@ void oled_task_user(void) {
|
||||
snprintf(rgbStatusLine2, sizeof(rgbStatusLine2), "h:%d s:%d v:%d", rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val());
|
||||
oled_write_ln(rgbStatusLine2, false);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -57,7 +57,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
// Host Keyboard Layer Status
|
||||
oled_write_ln_P(PSTR("ANAVI Macro Pad 8"), false);
|
||||
oled_write_P(PSTR("Active layer: "), false);
|
||||
@ -92,5 +92,6 @@ void oled_task_user(void) {
|
||||
snprintf(rgbStatusLine2, sizeof(rgbStatusLine2), "h:%d s:%d v:%d", rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val());
|
||||
oled_write_ln(rgbStatusLine2, false);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -38,7 +38,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
};
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
oled_write_P(PSTR("Layer: "), false);
|
||||
switch (biton32(layer_state)) {
|
||||
case BASE:
|
||||
@ -56,5 +56,6 @@ void oled_task_user(void) {
|
||||
oled_write_P(IS_HOST_LED_ON(USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false);
|
||||
oled_write_P(IS_HOST_LED_ON(USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false);
|
||||
oled_write_P(IS_HOST_LED_ON(USB_LED_SCROLL_LOCK) ? PSTR("SCRLCK ") : PSTR(" "), false);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -25,10 +25,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
};
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
// Host Keyboard LED Status
|
||||
oled_write_P(IS_HOST_LED_ON(USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false);
|
||||
oled_write_P(IS_HOST_LED_ON(USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false);
|
||||
oled_write_P(IS_HOST_LED_ON(USB_LED_SCROLL_LOCK) ? PSTR("SCRLCK ") : PSTR(" "), false);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -173,7 +173,7 @@ void matrix_scan_user(void) {
|
||||
}
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
oled_write_P(PSTR("Layer: "), false);
|
||||
switch (biton32(layer_state)) {
|
||||
case BASE:
|
||||
@ -191,5 +191,6 @@ void oled_task_user(void) {
|
||||
oled_write_P(IS_HOST_LED_ON(USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false);
|
||||
oled_write_P(IS_HOST_LED_ON(USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false);
|
||||
oled_write_P(IS_HOST_LED_ON(USB_LED_SCROLL_LOCK) ? PSTR("SCRLCK ") : PSTR(" "), false);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -113,8 +113,9 @@ static void render_logo(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
render_logo();
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -149,7 +149,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return rotation;
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
void render_status(void) {
|
||||
// Host Keyboard Layer Status
|
||||
oled_write_P(PSTR("Layer: "), false);
|
||||
@ -177,6 +177,7 @@ void oled_task_user(void) {
|
||||
oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
|
||||
oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
|
||||
oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -298,12 +298,13 @@ static void render_logo(void) {
|
||||
oled_write_raw_P(logo, 1024);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
|
||||
}
|
||||
else {
|
||||
render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -807,12 +807,13 @@ static void render_logo(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
|
||||
}
|
||||
else {
|
||||
render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -118,7 +118,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return isLeftHand ? OLED_ROTATION_180 : OLED_ROTATION_0;
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
// Host Keyboard Layer Status
|
||||
oled_write_P(PSTR("Layer: "), false);
|
||||
@ -142,5 +142,6 @@ void oled_task_user(void) {
|
||||
} else {
|
||||
oled_write(read_logo(), false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -118,7 +118,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return isLeftHand ? OLED_ROTATION_180 : OLED_ROTATION_0;
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
// Host Keyboard Layer Status
|
||||
oled_write_P(PSTR("Layer: "), false);
|
||||
@ -142,5 +142,6 @@ void oled_task_user(void) {
|
||||
} else {
|
||||
oled_write(read_logo(), false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -202,7 +202,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return isLeftHand ? OLED_ROTATION_180 : OLED_ROTATION_0;
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
// Host Keyboard Layer Status
|
||||
oled_write_P(PSTR("Layer: "), false);
|
||||
@ -232,5 +232,6 @@ void oled_task_user(void) {
|
||||
} else {
|
||||
oled_write(read_logo(), false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -99,7 +99,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return isLeftHand ? OLED_ROTATION_180 : OLED_ROTATION_0;
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
// Host Keyboard Layer Status
|
||||
oled_write_P(PSTR("Layer: "), false);
|
||||
@ -123,5 +123,6 @@ void oled_task_user(void) {
|
||||
} else {
|
||||
render_qmk_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -71,8 +71,9 @@ static void render_RIP(void) {
|
||||
oled_write_raw_P(my_logo, sizeof(my_logo));
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
render_RIP();
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -71,8 +71,9 @@ static void render_RIP(void) {
|
||||
oled_write_raw_P(my_logo, sizeof(my_logo));
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
render_RIP();
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -104,13 +104,14 @@ static void render_status(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
render_status();
|
||||
} else {
|
||||
render_logo();
|
||||
oled_scroll_left();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -92,13 +92,14 @@ static void render_status(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
render_status();
|
||||
} else {
|
||||
render_logo();
|
||||
oled_scroll_left();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -31,13 +31,12 @@ led_config_t g_led_config = { {
|
||||
#endif
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
__attribute__ ((weak))
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return OLED_ROTATION_180;
|
||||
}
|
||||
oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return OLED_ROTATION_180; }
|
||||
|
||||
__attribute__ ((weak))
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_kb(void) {
|
||||
if (!oled_task_user()) {
|
||||
return false;
|
||||
}
|
||||
oled_write_P(PSTR("BOSTON MK LAYER"), false);
|
||||
oled_advance_char();
|
||||
oled_write_char(get_highest_layer(layer_state) + 0x30, true);
|
||||
@ -94,5 +93,6 @@ void oled_task_user(void) {
|
||||
for (uint8_t y = 0; y < 8; y++) {
|
||||
oled_write_pixel(95, 0 + y, true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -39,5 +39,8 @@ static void render_logo(void) {
|
||||
|
||||
oled_write_P(qmk_logo, false);
|
||||
}
|
||||
void oled_task_user(void) { render_logo(); }
|
||||
bool oled_task_user(void) {
|
||||
render_logo();
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -38,5 +38,8 @@ static void render_logo(void) {
|
||||
|
||||
oled_write_P(qmk_logo, false);
|
||||
}
|
||||
void oled_task_user(void) { render_logo(); }
|
||||
bool oled_task_user(void) {
|
||||
render_logo();
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -5,16 +5,17 @@ void draw_clock(void);
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
|
||||
__attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_0; }
|
||||
oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return OLED_ROTATION_0; }
|
||||
|
||||
__attribute__((weak)) void oled_task_user(void) {
|
||||
bool oled_task_kb(void) {
|
||||
if (!oled_task_user()) { return false; }
|
||||
if (!oled_task_needs_to_repaint()) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
oled_clear();
|
||||
if (clock_set_mode) {
|
||||
draw_clock();
|
||||
return;
|
||||
return false;;
|
||||
}
|
||||
switch (oled_mode) {
|
||||
default:
|
||||
@ -25,6 +26,7 @@ __attribute__((weak)) void oled_task_user(void) {
|
||||
draw_clock();
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Request a repaint of the OLED image without resetting the OLED sleep timer.
|
||||
|
@ -101,12 +101,13 @@ void render_status(void) {
|
||||
RENDER_LED_STATUS();
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
render_status();
|
||||
} else {
|
||||
render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -210,8 +210,9 @@ void oled_write_layer_state(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
// If you want to change the display of OLED, you need to change here
|
||||
oled_write_layer_state();
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -59,7 +59,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
}
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
// Host Keyboard Layer Status
|
||||
oled_write_P(PSTR("Layer: "), false);
|
||||
switch (biton32(layer_state)) {
|
||||
@ -79,5 +79,6 @@ void oled_task_user(void) {
|
||||
oled_write_P(IS_LED_ON(usb_led, USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false);
|
||||
oled_write_P(IS_LED_ON(usb_led, USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false);
|
||||
oled_write_P(IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK) ? PSTR("SCRLCK ") : PSTR(" "), false);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -140,7 +140,7 @@ void set_keylog(uint16_t keycode, keyrecord_t *record) {
|
||||
const char *read_keylog(void) { return keylog_str; }
|
||||
const char *read_keylogs(void) { return keylogs_str; }
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
render_layer_state();
|
||||
oled_write_ln(read_keylog(), false);
|
||||
@ -148,6 +148,7 @@ void oled_task_user(void) {
|
||||
} else {
|
||||
render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
@ -130,7 +130,8 @@ void oled_render_amsterdam_flag(void) {
|
||||
oled_write_raw_P(amsterdam_flag, sizeof(amsterdam_flag));
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
oled_render_amsterdam_flag();
|
||||
return false;
|
||||
}
|
||||
#endif // OLED_ENABLE
|
||||
|
@ -128,12 +128,13 @@ void oled_render_logo(void) {
|
||||
oled_write_P(crkbd_logo, false);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
oled_render_layer_state();
|
||||
} else {
|
||||
oled_render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // OLED_ENABLE
|
||||
|
@ -157,13 +157,14 @@ void oled_render_logo(void) {
|
||||
oled_write_P(crkbd_logo, false);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
oled_render_layer_state();
|
||||
oled_render_keylog();
|
||||
} else {
|
||||
oled_render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
@ -392,13 +392,14 @@ void oled_render_logo(void) {
|
||||
oled_write_P(crkbd_logo, false);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_master) {
|
||||
oled_render_layer_state();
|
||||
oled_render_keylog();
|
||||
} else {
|
||||
oled_render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
@ -83,7 +83,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
}
|
||||
|
||||
const char *read_logo(void);
|
||||
void oled_task_user(void){
|
||||
bool oled_task_user(void){
|
||||
switch (biton32(layer_state)){
|
||||
case _DVORAK:
|
||||
oled_write_ln_P(PSTR("DVRK"), false);
|
||||
@ -102,5 +102,6 @@ void oled_task_user(void){
|
||||
}
|
||||
//now print logo
|
||||
oled_write(read_logo(), false);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -43,7 +43,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return is_keyboard_left() ? rotation : rotation ^ OLED_ROTATION_180;
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_left()) {
|
||||
render_mode_icon(!get_enable_kc_lang());
|
||||
render_layer_state();
|
||||
@ -51,5 +51,6 @@ void oled_task_user(void) {
|
||||
} else {
|
||||
render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif // OLED_ENABLE
|
||||
|
@ -246,7 +246,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return OLED_ROTATION_270;
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (timer_elapsed(oled_timer) > 10000) {
|
||||
oled_off();
|
||||
return;
|
||||
@ -262,4 +262,5 @@ void oled_task_user(void) {
|
||||
} else {
|
||||
render_status_secondary();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ void render_slave_oled(void) {
|
||||
}
|
||||
|
||||
// {OLED Task} -----------------------------------------------//
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
// First time out switches to logo as first indication of iddle.
|
||||
if (timer_elapsed32(oled_timer) > 100000 && timer_elapsed32(oled_timer) < 479999) {
|
||||
// Render logo on both halves before full timeout
|
||||
@ -209,5 +209,6 @@ void oled_task_user(void) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -308,7 +308,7 @@ static void render_logo(void){
|
||||
* @param void.
|
||||
* @return void.
|
||||
*/
|
||||
void oled_task_user(void){
|
||||
bool oled_task_user(void){
|
||||
if (timer_elapsed32(standby_oled_timer) > 15000){
|
||||
oled_off();
|
||||
}else{
|
||||
@ -321,6 +321,7 @@ void oled_task_user(void){
|
||||
oled_scroll_left();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** @brief process the current key and add it to the keylog string.
|
||||
|
@ -190,13 +190,14 @@ void render_status_main(void) {
|
||||
render_keylogger_status();
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
update_log();
|
||||
if (is_keyboard_master()) {
|
||||
render_status_main(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
|
||||
} else {
|
||||
render_crkbd_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
@ -148,13 +148,14 @@ void oled_render_logo(void) {
|
||||
oled_write_P(crkbd_logo, false);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
oled_render_layer_state();
|
||||
oled_render_keylog();
|
||||
} else {
|
||||
oled_render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
@ -158,13 +158,14 @@ void oled_render_logo(void) {
|
||||
oled_write_P(crkbd_logo, false);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
oled_render_layer_state();
|
||||
oled_render_keylog();
|
||||
} else {
|
||||
oled_render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
@ -204,13 +204,14 @@ void oled_render_logo(void) {
|
||||
oled_write_P(crkbd_logo, false);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
oled_render_layer_state();
|
||||
oled_render_keylog();
|
||||
} else {
|
||||
oled_render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
@ -290,7 +290,7 @@ void render_status(void) {
|
||||
# endif
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (timer_elapsed32(oled_timer) > OLED_TIMEOUT) {
|
||||
oled_off();
|
||||
return;
|
||||
@ -310,6 +310,7 @@ void oled_task_user(void) {
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -300,7 +300,7 @@ void suspend_power_down_user() {
|
||||
oled_off();
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (timer_elapsed32(oled_timer) > 30000) {
|
||||
oled_off();
|
||||
return;
|
||||
@ -314,6 +314,7 @@ void oled_task_user(void) {
|
||||
} else {
|
||||
render_status_secondary();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -137,13 +137,14 @@ void oled_render_logo(void) {
|
||||
oled_write_P(crkbd_logo, false);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
oled_render_layer_state();
|
||||
oled_render_keylog();
|
||||
} else {
|
||||
oled_render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
@ -153,4 +154,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
|
@ -164,13 +164,14 @@ void oled_render_logo(void) {
|
||||
oled_write_P(crkbd_logo, false);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_master) {
|
||||
oled_render_layer_state();
|
||||
oled_render_keylog();
|
||||
} else {
|
||||
oled_render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
@ -158,13 +158,14 @@ void oled_render_logo(void) {
|
||||
oled_write_P(crkbd_logo, false);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
oled_render_layer_state();
|
||||
oled_render_keylog();
|
||||
} else {
|
||||
oled_render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
@ -187,13 +187,14 @@ void oled_render_logo(void) {
|
||||
oled_write_P(crkbd_logo, false);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
oled_render_layer_state();
|
||||
oled_render_keylog();
|
||||
} else {
|
||||
oled_render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
@ -125,7 +125,7 @@ char* make_rgb_text(void){
|
||||
return s;
|
||||
};
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
render_logo();
|
||||
oled_set_cursor(0,3);
|
||||
if (rgbToggled) {
|
||||
@ -137,6 +137,7 @@ void oled_task_user(void) {
|
||||
oled_write_ln_P(s, false);
|
||||
free(s);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
@ -203,7 +203,7 @@ char* make_sys_info_text(void) {
|
||||
};
|
||||
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (!sysToggled) {
|
||||
render_logo();
|
||||
oled_set_cursor(0,3);
|
||||
@ -221,6 +221,7 @@ void oled_task_user(void) {
|
||||
free(s);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
int concat(int a, int b) {
|
||||
|
@ -67,7 +67,7 @@ static void render_logo(void) {
|
||||
oled_write_raw_P(ducky_logo, LOGO_SIZE);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
render_logo();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -220,7 +220,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
// Host Keyboard Layer Status
|
||||
oled_write_P(PSTR("Layer: "), false);
|
||||
|
||||
@ -244,5 +244,6 @@ void oled_task_user(void) {
|
||||
|
||||
oled_write_P(PSTR("Mode: "), false);
|
||||
oled_write_ln(rgb_mode_name, false);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -89,7 +89,7 @@ static void render_anim(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
render_anim();
|
||||
oled_set_cursor(0,6);
|
||||
oled_write_P(PSTR("DUCK\nBOARD\n"), false);
|
||||
@ -109,6 +109,7 @@ void oled_task_user(void) {
|
||||
oled_write_P(PSTR("RGB\n"), false);
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -89,7 +89,7 @@ static void render_anim(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
render_anim();
|
||||
oled_set_cursor(0,6);
|
||||
oled_write_P(PSTR("DUCK\nBOARD\n"), false);
|
||||
@ -109,6 +109,7 @@ void oled_task_user(void) {
|
||||
oled_write_P(PSTR("RGB\n"), false);
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -96,7 +96,7 @@ static void render_anim(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
render_anim();
|
||||
oled_set_cursor(0,6);
|
||||
oled_write_P(PSTR("DUCK\nBOARD\n"), false);
|
||||
@ -119,6 +119,7 @@ void oled_task_user(void) {
|
||||
oled_write_P(PSTR("FN2\n"), false);
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -186,12 +186,13 @@ static void render_status(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
|
||||
} else {
|
||||
render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -200,12 +200,13 @@ static void render_status(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
|
||||
} else {
|
||||
render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -179,12 +179,13 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return rotation;
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
print_status_narrow();
|
||||
} else {
|
||||
render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -375,7 +375,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return rotation;
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
print_status_narrow();
|
||||
sprintf(wpm_str, "%03d", get_current_wpm());
|
||||
@ -383,6 +383,7 @@ void oled_task_user(void) {
|
||||
} else {
|
||||
render_anim();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -56,7 +56,8 @@ const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT(
|
||||
#endif
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
__attribute__((weak)) void oled_task_user(void) {
|
||||
bool oled_task_kb(void) {
|
||||
if (!oled_task_user()) { return false; }
|
||||
// Host Keyboard Layer Status
|
||||
oled_write_P(PSTR("Layer: "), false);
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
@ -95,7 +96,9 @@ __attribute__((weak)) void oled_task_user(void) {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 4,253,197,197,197,197,197,197,197,197,197,197,199,192,192, 0,255,255, 0,255, 0,255,255, 0,254, 13, 27, 55,111,222,188,120,255, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0,255,197,197,197,197,197,197,197,197,197,197,253,253,255,131,254, 0, 0,255,255, 0,255,184,220,238,247,219,205,198,195,193,192,255,255,255,128,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 3, 3, 2, 3, 0, 3, 3, 2, 3, 0, 0, 0, 0, 0, 1, 3, 2, 2, 3, 0, 8, 28, 20, 20, 20, 20, 20, 28, 8, 0, 1, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 0, 0, 1, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
oled_write_raw_P(ein60_logo, sizeof(ein60_logo));
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -167,11 +167,12 @@ static void render_status(void) {
|
||||
oled_set_cursor(1,2);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
|
||||
render_status();
|
||||
oled_write_ln_P(PSTR(""), false);
|
||||
render_ein60_logo();
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -104,7 +104,7 @@ static void render_ein60_logo(void) {
|
||||
|
||||
|
||||
static void render_status(void) {
|
||||
//void oled_task_user(void) {
|
||||
//bool oled_task_user(void) {
|
||||
|
||||
// Host Keyboard Layer Status
|
||||
oled_write_P(PSTR("Layer: "), false);
|
||||
@ -145,12 +145,13 @@ static void render_status(void) {
|
||||
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
|
||||
render_status();
|
||||
oled_write_ln_P(PSTR(""), false);
|
||||
render_ein60_logo();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -172,5 +173,3 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -166,11 +166,13 @@ static void render_status(void) {
|
||||
oled_set_cursor(1,2);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
|
||||
render_status();
|
||||
oled_write_ln_P(PSTR(""), false);
|
||||
render_ein60_logo();
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -130,13 +130,14 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return OLED_ROTATION_180;
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
static const char PROGMEM font_logo[] = {
|
||||
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
|
||||
0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
|
||||
0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0};
|
||||
oled_write_P(font_logo, false);
|
||||
|
||||
return false;
|
||||
}
|
||||
//for (int i = 0; i < fontLen; i++) {
|
||||
//oled_write_char(pgm_read_byte(lain+i), false);
|
||||
|
@ -182,7 +182,7 @@ void render_status(void) {
|
||||
render_keylock_status(host_keyboard_led_state());
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
static const char PROGMEM font_logo[] = {
|
||||
0x80,0x81,0x82,0x83,0x84,
|
||||
0xa0,0xa1,0xa2,0xa3,0xa4,
|
||||
@ -199,6 +199,7 @@ void oled_task_user(void) {
|
||||
oled_write_P(font_logo, false);
|
||||
|
||||
render_status(); // Renders the current keyboard state (layer, lock)
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,13 +1,12 @@
|
||||
#include "ver2.h"
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
__attribute__ ((weak))
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return OLED_ROTATION_180;
|
||||
}
|
||||
oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return OLED_ROTATION_180; }
|
||||
|
||||
__attribute__ ((weak))
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_kb(void) {
|
||||
if (!oled_task_user()) {
|
||||
return false;
|
||||
}
|
||||
oled_write_P(PSTR("LAYER "), false);
|
||||
oled_write_char(get_highest_layer(layer_state) + 0x30, true);
|
||||
|
||||
@ -61,5 +60,6 @@ void oled_task_user(void) {
|
||||
for (uint8_t y = 0; y < 8; y++) {
|
||||
oled_write_pixel(35, 0 + y, true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -34,13 +34,12 @@ led_config_t g_led_config = { {
|
||||
#endif
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
__attribute__ ((weak))
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return OLED_ROTATION_180;
|
||||
}
|
||||
oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return OLED_ROTATION_180; }
|
||||
|
||||
__attribute__ ((weak))
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_kb(void) {
|
||||
if (!oled_task_user()) {
|
||||
return false;
|
||||
}
|
||||
oled_write_P(PSTR("LAYER"), false);
|
||||
oled_advance_char();
|
||||
oled_write_char(get_highest_layer(layer_state) + 0x30, true);
|
||||
@ -94,5 +93,6 @@ void oled_task_user(void) {
|
||||
for (uint8_t y = 0; y < 8; y++) {
|
||||
oled_write_pixel(35, 0 + y, true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -27,14 +27,18 @@ enum layer_names {
|
||||
/* _FN */
|
||||
};
|
||||
|
||||
__attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
|
||||
if (!is_keyboard_master()) {
|
||||
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
|
||||
}
|
||||
return rotation;
|
||||
}
|
||||
oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return OLED_ROTATION_180; }
|
||||
|
||||
__attribute__((weak)) void oled_task_user(void) {
|
||||
bool oled_task_kb(void) {
|
||||
if (!oled_task_user()) {
|
||||
return false;
|
||||
}
|
||||
if (!is_keyboard_master()) {
|
||||
static const char PROGMEM qmk_logo[] = {
|
||||
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94,
|
||||
@ -68,6 +72,7 @@ __attribute__((weak)) void oled_task_user(void) {
|
||||
oled_write_P(led_state.caps_lock ? PSTR("CAPLCK ") : PSTR(" "), false);
|
||||
oled_write_P(led_state.scroll_lock ? PSTR("SCRLCK\n") : PSTR(" \n"), false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -85,8 +85,9 @@ static void render_amigopunk_logo(void) {
|
||||
};
|
||||
oled_write_raw_P(amigopunk_logo, sizeof(amigopunk_logo));
|
||||
}
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
render_amigopunk_logo();
|
||||
/* oled_write_P(PSTR("Amigo Punk\n"), false); */
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -251,7 +251,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return OLED_ROTATION_0;
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
/* Host Keyboard Layer Status */
|
||||
uint8_t current_layer = get_highest_layer(layer_state);
|
||||
|
||||
@ -337,5 +337,6 @@ void oled_task_user(void) {
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -196,7 +196,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return OLED_ROTATION_0;
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
/* Host Keyboard Layer Status */
|
||||
uint8_t current_layer = get_highest_layer(layer_state);
|
||||
|
||||
@ -282,5 +282,6 @@ void oled_task_user(void) {
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -115,7 +115,7 @@ void write_quote(const char* data, const uint8_t num_lines) {
|
||||
}
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
render_logo();
|
||||
oled_advance_page(/* clearPageRemainder */ true);
|
||||
@ -559,6 +559,7 @@ void oled_task_user(void) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
|
@ -156,7 +156,7 @@ static void render_anim(void) {
|
||||
}
|
||||
|
||||
// Used to draw on to the oled screen
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
render_anim(); // renders pixelart
|
||||
|
||||
oled_set_cursor(0, 0); // sets cursor to (row, column) using charactar spacing (4 rows, 21 full columns on a 128x32 screen, anything more will overflow back to the top)
|
||||
@ -194,5 +194,6 @@ void oled_task_user(void) {
|
||||
}
|
||||
oled_set_cursor(17, 3);
|
||||
oled_write_P(PSTR("NKRO"), keymap_config.nkro);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -195,12 +195,13 @@ void render_keylogger_status(void) {
|
||||
// [OLED Init] ------------------------------------------------------//
|
||||
|
||||
// Rotate Screen
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return OLED_ROTATION_180;
|
||||
}
|
||||
oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return OLED_ROTATION_180; }
|
||||
|
||||
// {OLED Task} ------------------------------------------------------//
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_kb(void) {
|
||||
if (!oled_task_user()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// MASTER SIDE
|
||||
if (is_keyboard_master()) {
|
||||
@ -225,5 +226,5 @@ if (is_keyboard_master()) {
|
||||
else {
|
||||
render_skeeb_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -342,7 +342,7 @@ void matrix_init_user(void) {
|
||||
set_unicode_input_mode(UC_WINC);
|
||||
};
|
||||
#ifdef OLED_ENABLE
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
oled_write_P(PSTR(" spaget v1\n\n"), false);
|
||||
|
||||
// Host Keyboard Layer Status
|
||||
@ -368,6 +368,7 @@ void oled_task_user(void) {
|
||||
oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
|
||||
oled_write_P(led_state.caps_lock ? PSTR("CAPS ") : PSTR(" "), false);
|
||||
oled_write_P(led_state.scroll_lock ? PSTR("SCROLL ") : PSTR(" "), false);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -361,7 +361,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return rotation;
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (update_speed_test) {
|
||||
// Speed test mode - wait for screen update completion.
|
||||
if (!oled_dirty) {
|
||||
@ -450,6 +450,7 @@ void oled_task_user(void) {
|
||||
oled_write_P(PSTR("Draw Once"), false);
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
|
@ -66,7 +66,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
//return OLED_ROTATION_180;
|
||||
return OLED_ROTATION_180;
|
||||
}
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
// Host Keyboard Layer Status
|
||||
/*oled_write_P(PSTR("Lyr: "), false);
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
@ -92,5 +92,6 @@ void oled_task_user(void) {
|
||||
};
|
||||
|
||||
oled_write_P(qmk_logo, false);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -66,8 +66,9 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return rotation;
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
render_oled();
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -18,11 +18,14 @@
|
||||
// OLED Code inspired by https://github.com/qmk/qmk_firmware/blob/master/keyboards/splitkb/kyria/rev1/rev1.c
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
__attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
|
||||
return OLED_ROTATION_180;
|
||||
}
|
||||
|
||||
__attribute__((weak)) void oled_task_user(void) {
|
||||
bool oled_task_kb(void) {
|
||||
if (!oled_task_user()) {
|
||||
return false;
|
||||
}
|
||||
if (is_keyboard_master()) {
|
||||
static const char PROGMEM qmk_logo[] = {
|
||||
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
|
||||
@ -126,5 +129,6 @@ __attribute__((weak)) void oled_task_user(void) {
|
||||
};
|
||||
oled_write_raw_P(split65_logo, sizeof(split65_logo));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -119,7 +119,8 @@ static void render_anim(void){
|
||||
}
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
render_anim();
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -119,7 +119,8 @@ static void render_anim(void){
|
||||
}
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
render_anim();
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -99,7 +99,8 @@ static void render_anim(void){
|
||||
}
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
render_anim();
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user