diff options
author | Drashna Jaelre <drashna@live.com> | 2021-11-01 15:42:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-02 09:42:50 +1100 |
commit | 9d235d4fc5c34f372b0c393f41686b5ef4f8dc13 (patch) | |
tree | c155fae4cd6043c3c32aa185eb05c5d1a4a5700e /keyboards/pteron36 | |
parent | f775da96b17ceec66bac279434325b4da5cb9467 (diff) | |
download | qmk_firmware-9d235d4fc5c34f372b0c393f41686b5ef4f8dc13.tar.gz qmk_firmware-9d235d4fc5c34f372b0c393f41686b5ef4f8dc13.zip |
[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
Diffstat (limited to 'keyboards/pteron36')
-rw-r--r-- | keyboards/pteron36/keymaps/via/keymap.c | 31 | ||||
-rw-r--r-- | keyboards/pteron36/pteron36.c | 6 |
2 files changed, 21 insertions, 16 deletions
diff --git a/keyboards/pteron36/keymaps/via/keymap.c b/keyboards/pteron36/keymaps/via/keymap.c index ce96ea6c5..40e3088a8 100644 --- a/keyboards/pteron36/keymaps/via/keymap.c +++ b/keyboards/pteron36/keymaps/via/keymap.c | |||
@@ -1,19 +1,19 @@ | |||
1 | /* Copyright HarshitGoel96 2020 | 1 | /* Copyright HarshitGoel96 2020 |
2 | * With permission from mattdibi, the original maintainer of the Redox hardware. | 2 | * With permission from mattdibi, the original maintainer of the Redox hardware. |
3 | * | 3 | * |
4 | * This program is free software: you can redistribute it and/or modify | 4 | * This program is free software: you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
6 | * the Free Software Foundation, either version 2 of the License, or | 6 | * the Free Software Foundation, either version 2 of the License, or |
7 | * (at your option) any later version. | 7 | * (at your option) any later version. |
8 | * | 8 | * |
9 | * This program is distributed in the hope that it will be useful, | 9 | * This program is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
13 | * | 13 | * |
14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License |
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | */ | 16 | */ |
17 | #include QMK_KEYBOARD_H | 17 | #include QMK_KEYBOARD_H |
18 | 18 | ||
19 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | 19 | // 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){ | |||
131 | oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); | 131 | oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); |
132 | oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); | 132 | oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); |
133 | } | 133 | } |
134 | void oled_task_user(void) { | 134 | bool oled_task_user(void) { |
135 | if (is_keyboard_master()) { | 135 | if (is_keyboard_master()) { |
136 | render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) | 136 | render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) |
137 | } else { | 137 | } else { |
138 | render_logo(); // Renders a static logo | 138 | render_logo(); // Renders a static logo |
139 | oled_scroll_left(); // Turns on scrolling | 139 | oled_scroll_left(); // Turns on scrolling |
140 | } | 140 | } |
141 | return false; | ||
141 | } | 142 | } |
142 | #endif | 143 | #endif |
diff --git a/keyboards/pteron36/pteron36.c b/keyboards/pteron36/pteron36.c index 3288626f0..b7f7d8d44 100644 --- a/keyboards/pteron36/pteron36.c +++ b/keyboards/pteron36/pteron36.c | |||
@@ -37,7 +37,10 @@ bool encoder_update_kb(uint8_t index, bool clockwise) { | |||
37 | } | 37 | } |
38 | //common oled support. | 38 | //common oled support. |
39 | #ifdef OLED_DRIVER_ENABLE | 39 | #ifdef OLED_DRIVER_ENABLE |
40 | __attribute__((weak)) void oled_task_user(void) { | 40 | bool oled_task_kb(void) { |
41 | if (!oled_task_user()) { | ||
42 | return false; | ||
43 | } | ||
41 | if (is_keyboard_master()) { | 44 | if (is_keyboard_master()) { |
42 | oled_write_P(PSTR("Layer: "), false); | 45 | oled_write_P(PSTR("Layer: "), false); |
43 | switch (get_highest_layer(layer_state)) { | 46 | switch (get_highest_layer(layer_state)) { |
@@ -62,5 +65,6 @@ __attribute__((weak)) void oled_task_user(void) { | |||
62 | oled_write_P(qmk_logo, false); | 65 | oled_write_P(qmk_logo, false); |
63 | oled_scroll_left(); // Turns on scrolling | 66 | oled_scroll_left(); // Turns on scrolling |
64 | } | 67 | } |
68 | return false; | ||
65 | } | 69 | } |
66 | #endif | 70 | #endif |