[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
272 changed files with 967 additions and 599 deletions
|
@ -171,7 +171,7 @@ void write_layer_state(void) {
|
|||
oled_advance_page(true);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
write_layer_state();
|
||||
oled_write_ln(read_keylog(), false);
|
||||
|
@ -179,6 +179,7 @@ void oled_task_user(void) {
|
|||
} else {
|
||||
oled_write(read_logo(), false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ const char *read_timelog(void);
|
|||
|
||||
char encoder_debug[24];
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
// Host Keyboard Layer Status
|
||||
snprintf(encoder_debug, sizeof(encoder_debug), "%i %i", counter, lastIndex );
|
||||
if (is_keyboard_master()) {
|
||||
|
@ -168,6 +168,7 @@ void oled_task_user(void) {
|
|||
oled_write(read_logo(), false);
|
||||
// oled_write_ln(encoder_debug, false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif //OLED_ENABLE
|
||||
|
||||
|
|
|
@ -114,8 +114,8 @@ 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) {
|
||||
oled_write_ln(read_logo(), false);
|
||||
return false;
|
||||
}
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
|
|
|
@ -219,12 +219,13 @@ static void render_lfc_logo(void) {
|
|||
oled_write_raw_P(my_lfc_logo, sizeof(my_lfc_logo));
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
render_logo();
|
||||
} else {
|
||||
render_lfc_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
|
@ -263,4 +264,3 @@ const char *read_layer_state(void) {
|
|||
|
||||
return layer_state_str;
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ const char *read_keylogs(void);
|
|||
// void set_timelog(void);
|
||||
// const char *read_timelog(void);
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
// If you want to change the display of OLED, you need to change here
|
||||
oled_write_ln(read_layer_state(), false);
|
||||
|
@ -134,6 +134,7 @@ void oled_task_user(void) {
|
|||
} else {
|
||||
oled_write(read_logo(), false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
/* Copyright 2020 Domantas Petrauskas
|
||||
*
|
||||
* 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
|
||||
#include <stdio.h>
|
||||
|
@ -275,10 +275,11 @@ static void render_status(void) {
|
|||
oled_write_ln_P(PSTR("caps"), led_state.caps_lock);
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_left()) {
|
||||
render_status();
|
||||
} else {
|
||||
render_bongo_cat();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ void set_keylog(uint16_t keycode, keyrecord_t *record);
|
|||
// void set_timelog(void);
|
||||
// const char *read_timelog(void);
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
// If you want to change the display of OLED, you need to change here
|
||||
oled_write_ln(read_layer_state(), false);
|
||||
|
@ -104,6 +104,7 @@ void oled_task_user(void) {
|
|||
} else {
|
||||
oled_write(read_logo(), false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
|
|
|
@ -271,13 +271,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_lily58_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
|
|
@ -156,7 +156,7 @@ const char *read_keylogs(void);
|
|||
// void set_timelog(void);
|
||||
// const char *read_timelog(void);
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
// If you want to change the display of OLED, you need to change here
|
||||
oled_write_ln(read_layer_state(), false);
|
||||
|
@ -168,6 +168,7 @@ void oled_task_user(void) {
|
|||
} else {
|
||||
oled_write(read_logo(), false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
|
@ -211,4 +212,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -174,11 +174,12 @@ static void render_anim(void) {
|
|||
}
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
render_status();
|
||||
} else {
|
||||
render_anim();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -299,7 +299,7 @@ const char *read_timelog(void);
|
|||
|
||||
char encoder_debug[24];
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
// Host Keyboard Layer Status
|
||||
if (is_keyboard_master()) {
|
||||
// If you want to change the display of OLED, you need to change here
|
||||
|
@ -313,6 +313,7 @@ void oled_task_user(void) {
|
|||
oled_write(read_logo(), false);
|
||||
// oled_write_ln(encoder_debug, false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif //OLED_ENABLE
|
||||
|
|
|
@ -186,7 +186,7 @@ const char *read_keylogs(void) {
|
|||
}
|
||||
//new
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
// Host Keyboard Layer Status
|
||||
oled_write_P(PSTR("Layer: "), false);
|
||||
|
@ -214,6 +214,7 @@ void oled_task_user(void) {
|
|||
} else {
|
||||
render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
|
|
|
@ -158,7 +158,7 @@ const char *read_keylogs(void);
|
|||
// void set_timelog(void);
|
||||
// const char *read_timelog(void);
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
// If you want to change the display of OLED, you need to change here
|
||||
oled_write_ln(read_layer_state(), false);
|
||||
|
@ -170,6 +170,7 @@ void oled_task_user(void) {
|
|||
} else {
|
||||
oled_write(read_logo(), false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ const char *read_keylogs(void);
|
|||
// void set_timelog(void);
|
||||
// const char *read_timelog(void);
|
||||
|
||||
void oled_task_user(void) {
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
// If you want to change the display of OLED, you need to change here
|
||||
oled_write_ln(read_layer_state(), false);
|
||||
|
@ -152,6 +152,7 @@ void oled_task_user(void) {
|
|||
} else {
|
||||
oled_write(read_logo(), false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue