From 9d235d4fc5c34f372b0c393f41686b5ef4f8dc13 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 1 Nov 2021 15:42:50 -0700 Subject: [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 --- keyboards/yampad/keymaps/default/keymap.c | 4 +++- keyboards/yampad/keymaps/traditional/keymap.c | 4 +++- keyboards/yampad/keymaps/via/keymap.c | 4 +++- keyboards/yampad/yampad.c | 13 ++++++++----- 4 files changed, 17 insertions(+), 8 deletions(-) (limited to 'keyboards/yampad') diff --git a/keyboards/yampad/keymaps/default/keymap.c b/keyboards/yampad/keymaps/default/keymap.c index d22eb26177..51d921be3f 100644 --- a/keyboards/yampad/keymaps/default/keymap.c +++ b/keyboards/yampad/keymaps/default/keymap.c @@ -122,7 +122,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; // flips the display 270 degrees } -void oled_task_user(void) { +bool oled_task_user(void) { // Host Keyboard Layer Status oled_write_P(PSTR("Layer"), false); switch (get_highest_layer(layer_state)) { @@ -159,5 +159,7 @@ void oled_task_user(void) { (uint8_t)(rgblight_get_sat() / RGBLIGHT_SAT_STEP), (uint8_t)(rgblight_get_val() / RGBLIGHT_VAL_STEP)); oled_write(led_buf, false); + + return false; } #endif diff --git a/keyboards/yampad/keymaps/traditional/keymap.c b/keyboards/yampad/keymaps/traditional/keymap.c index 57462c050c..78778cc34b 100644 --- a/keyboards/yampad/keymaps/traditional/keymap.c +++ b/keyboards/yampad/keymaps/traditional/keymap.c @@ -122,7 +122,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; // flips the display 270 degrees } -void oled_task_user(void) { +bool oled_task_user(void) { // Host Keyboard Layer Status oled_write_P(PSTR("Layer"), false); switch (get_highest_layer(layer_state)) { @@ -159,5 +159,7 @@ void oled_task_user(void) { (uint8_t)(rgblight_get_sat() / RGBLIGHT_SAT_STEP), (uint8_t)(rgblight_get_val() / RGBLIGHT_VAL_STEP)); oled_write(led_buf, false); + + return false; } #endif diff --git a/keyboards/yampad/keymaps/via/keymap.c b/keyboards/yampad/keymaps/via/keymap.c index d22eb26177..51d921be3f 100644 --- a/keyboards/yampad/keymaps/via/keymap.c +++ b/keyboards/yampad/keymaps/via/keymap.c @@ -122,7 +122,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; // flips the display 270 degrees } -void oled_task_user(void) { +bool oled_task_user(void) { // Host Keyboard Layer Status oled_write_P(PSTR("Layer"), false); switch (get_highest_layer(layer_state)) { @@ -159,5 +159,7 @@ void oled_task_user(void) { (uint8_t)(rgblight_get_sat() / RGBLIGHT_SAT_STEP), (uint8_t)(rgblight_get_val() / RGBLIGHT_VAL_STEP)); oled_write(led_buf, false); + + return false; } #endif diff --git a/keyboards/yampad/yampad.c b/keyboards/yampad/yampad.c index 950a987219..eab218d3b9 100644 --- a/keyboards/yampad/yampad.c +++ b/keyboards/yampad/yampad.c @@ -17,13 +17,14 @@ #include "yampad.h" #if defined(OLED_ENABLE) -__attribute__((weak)) -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return OLED_ROTATION_270; // flips the display 270 degrees +oled_rotation_t oled_init_kb(oled_rotation_t rotation) { + return OLED_ROTATION_270; } -__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)) { @@ -60,5 +61,7 @@ void oled_task_user(void) { (uint8_t)(rgblight_get_sat() / RGBLIGHT_SAT_STEP), (uint8_t)(rgblight_get_val() / RGBLIGHT_VAL_STEP)); oled_write(led_buf, false); + + return false; } #endif -- cgit v1.2.3