[Core] Refactor OLED to allow easy addition of other types (#13454)
* add docs * core changes * update keyboards to new OLED * updated users to new OLED * update layouts to new OLED * fixup docs * drashna's suggestion * fix up docs * new keyboards with oled * core split changes * remaining keyboard files * Fix The Helix keyboards oled options * reflect develop Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: mtei <2170248+mtei@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									6fd20acf4b
								
							
						
					
					
						commit
						4e1c5887c5
					
				
					 500 changed files with 1579 additions and 1387 deletions
				
			
		| 
						 | 
				
			
			@ -140,7 +140,7 @@
 | 
			
		|||
#    define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_REST_MODE
 | 
			
		||||
#endif  // RGB_MATRIX_ENABLE
 | 
			
		||||
 | 
			
		||||
#ifdef OLED_DRIVER_ENABLE
 | 
			
		||||
#ifdef OLED_ENABLE
 | 
			
		||||
#    ifdef SPLIT_KEYBOARD
 | 
			
		||||
#        define OLED_UPDATE_INTERVAL 60
 | 
			
		||||
#    else
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -114,8 +114,9 @@ void                       shutdown_user(void) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
__attribute__((weak)) void suspend_power_down_keymap(void) {}
 | 
			
		||||
void                       suspend_power_down_user(void) {
 | 
			
		||||
#ifdef OLED_DRIVER_ENABLE
 | 
			
		||||
 | 
			
		||||
void suspend_power_down_user(void) {
 | 
			
		||||
#ifdef OLED_ENABLE
 | 
			
		||||
    oled_off();
 | 
			
		||||
#endif
 | 
			
		||||
    suspend_power_down_keymap();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -29,7 +29,7 @@
 | 
			
		|||
#if defined(RGB_MATRIX_ENABLE)
 | 
			
		||||
#    include "rgb_matrix_stuff.h"
 | 
			
		||||
#endif
 | 
			
		||||
#if defined(OLED_DRIVER_ENABLE)
 | 
			
		||||
#if defined(OLED_ENABLE)
 | 
			
		||||
#    include "oled_stuff.h"
 | 
			
		||||
#endif
 | 
			
		||||
#if defined(PIMORONI_TRACKBALL_ENABLE)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -70,7 +70,7 @@ void add_keylog(uint16_t keycode) {
 | 
			
		|||
 | 
			
		||||
bool process_record_user_oled(uint16_t keycode, keyrecord_t *record) {
 | 
			
		||||
    if (record->event.pressed) {
 | 
			
		||||
#ifdef OLED_DRIVER_ENABLE
 | 
			
		||||
#ifdef OLED_ENABLE
 | 
			
		||||
        oled_timer = timer_read32();
 | 
			
		||||
        add_keylog(keycode);
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -29,7 +29,7 @@ bool                       process_record_user(uint16_t keycode, keyrecord_t *re
 | 
			
		|||
#ifdef KEYLOGGER_ENABLE
 | 
			
		||||
    uprintf("KL: kc: 0x%04X, col: %2u, row: %2u, pressed: %b, time: %5u, int: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count);
 | 
			
		||||
#endif  // KEYLOGGER_ENABLE
 | 
			
		||||
#ifdef OLED_DRIVER_ENABLE
 | 
			
		||||
#ifdef OLED_ENABLE
 | 
			
		||||
    process_record_user_oled(keycode, record);
 | 
			
		||||
#endif  // OLED
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -64,7 +64,7 @@ ifeq ($(strip $(PROTOCOL)), VUSB)
 | 
			
		|||
endif
 | 
			
		||||
 | 
			
		||||
CUSTOM_OLED_DRIVER ?= yes
 | 
			
		||||
ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes)
 | 
			
		||||
ifeq ($(strip $(OLED_ENABLE)), yes)
 | 
			
		||||
    ifeq ($(strip $(CUSTOM_OLED_DRIVER)), yes)
 | 
			
		||||
        SRC += oled_stuff.c
 | 
			
		||||
        OPT_DEFS += -DCUSTOM_OLED_DRIVER_CODE
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -71,6 +71,10 @@ void keyboard_post_init_transport_sync(void) {
 | 
			
		|||
 | 
			
		||||
void user_transport_update(void) {
 | 
			
		||||
    if (is_keyboard_master()) {
 | 
			
		||||
#    ifdef OLED_ENABLE
 | 
			
		||||
        user_state.oled_on = is_oled_on();
 | 
			
		||||
#    endif
 | 
			
		||||
 | 
			
		||||
        transport_keymap_config    = keymap_config.raw;
 | 
			
		||||
        transport_userspace_config = userspace_config.raw;
 | 
			
		||||
#ifdef AUDIO_ENABLE
 | 
			
		||||
| 
						 | 
				
			
			@ -85,6 +89,13 @@ void user_transport_update(void) {
 | 
			
		|||
#endif
 | 
			
		||||
 | 
			
		||||
    } else {
 | 
			
		||||
#    ifdef OLED_ENABLE
 | 
			
		||||
        if (user_state.oled_on) {
 | 
			
		||||
            oled_on();
 | 
			
		||||
        } else {
 | 
			
		||||
            oled_off();
 | 
			
		||||
        }
 | 
			
		||||
#    endif
 | 
			
		||||
        keymap_config.raw    = transport_keymap_config;
 | 
			
		||||
        userspace_config.raw = transport_userspace_config;
 | 
			
		||||
#ifdef UNICODE_ENABLE
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue