From 9d235d4fc5c34f372b0c393f41686b5ef4f8dc13 Mon Sep 17 00:00:00 2001
From: Drashna Jaelre <drashna@live.com>
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/pteron36/keymaps/via/keymap.c | 31 ++++++++++++++++---------------
 keyboards/pteron36/pteron36.c           |  6 +++++-
 2 files changed, 21 insertions(+), 16 deletions(-)

(limited to 'keyboards/pteron36')

diff --git a/keyboards/pteron36/keymaps/via/keymap.c b/keyboards/pteron36/keymaps/via/keymap.c
index ce96ea6c59..40e3088a8e 100644
--- a/keyboards/pteron36/keymaps/via/keymap.c
+++ b/keyboards/pteron36/keymaps/via/keymap.c
@@ -1,19 +1,19 @@
  /* Copyright HarshitGoel96 2020
   * With permission from mattdibi, the original maintainer of the Redox hardware.
-  * 
-  * This program is free software: you can redistribute it and/or modify 
-  * it under the terms of the GNU General Public License as published by 
-  * the Free Software Foundation, either version 2 of the License, or 
-  * (at your option) any later version. 
-  * 
-  * This program is distributed in the hope that it will be useful, 
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
-  * GNU General Public License for more details. 
-  * 
-  * You should have received a copy of the GNU General Public License 
-  * along with this program.  If not, see <http://www.gnu.org/licenses/>. 
-  */ 
+  *
+  * This program is free software: you can redistribute it and/or modify
+  * it under the terms of the GNU General Public License as published by
+  * the Free Software Foundation, either version 2 of the License, or
+  * (at your option) any later version.
+  *
+  * This program is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  * GNU General Public License for more details.
+  *
+  * You should have received a copy of the GNU General Public License
+  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  */
 #include QMK_KEYBOARD_H
 
 // Each layer gets a name for readability, which is then used in the keymap matrix below.
@@ -131,12 +131,13 @@ static void render_status(void){
     oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR("    "), false);
     oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR("    "), false);
 }
-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
diff --git a/keyboards/pteron36/pteron36.c b/keyboards/pteron36/pteron36.c
index 3288626f00..b7f7d8d44d 100644
--- a/keyboards/pteron36/pteron36.c
+++ b/keyboards/pteron36/pteron36.c
@@ -37,7 +37,10 @@ bool encoder_update_kb(uint8_t index, bool clockwise) {
 }
 //common oled support.
 #ifdef OLED_DRIVER_ENABLE
-__attribute__((weak)) void oled_task_user(void) {
+bool oled_task_kb(void) {
+    if (!oled_task_user()) {
+        return false;
+    }
     if (is_keyboard_master()) {
         oled_write_P(PSTR("Layer: "), false);
         switch (get_highest_layer(layer_state)) {
@@ -62,5 +65,6 @@ __attribute__((weak)) void oled_task_user(void) {
         oled_write_P(qmk_logo, false);
         oled_scroll_left();  // Turns on scrolling
     }
+    return false;
 }
 #endif
-- 
cgit v1.2.3