[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
				
			
		| 
						 | 
				
			
			@ -190,6 +190,7 @@ bool oled_init(oled_rotation_t rotation);
 | 
			
		|||
// Called at the start of oled_init, weak function overridable by the user
 | 
			
		||||
// rotation - the value passed into oled_init
 | 
			
		||||
// Return new oled_rotation_t if you want to override default rotation
 | 
			
		||||
oled_rotation_t oled_init_kb(oled_rotation_t rotation);
 | 
			
		||||
oled_rotation_t oled_init_user(oled_rotation_t rotation);
 | 
			
		||||
 | 
			
		||||
// Clears the display buffer, resets cursor position to 0, and sets the buffer to dirty for rendering
 | 
			
		||||
| 
						 | 
				
			
			@ -285,7 +286,8 @@ uint8_t oled_get_brightness(void);
 | 
			
		|||
void oled_task(void);
 | 
			
		||||
 | 
			
		||||
// Called at the start of oled_task, weak function overridable by the user
 | 
			
		||||
void oled_task_user(void);
 | 
			
		||||
bool oled_task_kb(void);
 | 
			
		||||
bool oled_task_user(void);
 | 
			
		||||
 | 
			
		||||
// Set the specific 8 lines rows of the screen to scroll.
 | 
			
		||||
// 0 is the default for start, and 7 for end, which is the entire
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -167,7 +167,7 @@ bool oled_init(oled_rotation_t rotation) {
 | 
			
		|||
    }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    oled_rotation = oled_init_user(rotation);
 | 
			
		||||
    oled_rotation = oled_init_user(oled_init_kb(rotation));
 | 
			
		||||
    if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) {
 | 
			
		||||
        oled_rotation_width = OLED_DISPLAY_WIDTH;
 | 
			
		||||
    } else {
 | 
			
		||||
| 
						 | 
				
			
			@ -232,6 +232,7 @@ bool oled_init(oled_rotation_t rotation) {
 | 
			
		|||
    return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
__attribute__((weak)) oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return rotation; }
 | 
			
		||||
__attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) { return rotation; }
 | 
			
		||||
 | 
			
		||||
void oled_clear(void) {
 | 
			
		||||
| 
						 | 
				
			
			@ -741,11 +742,11 @@ void oled_task(void) {
 | 
			
		|||
    if (timer_elapsed(oled_update_timeout) >= OLED_UPDATE_INTERVAL) {
 | 
			
		||||
        oled_update_timeout = timer_read();
 | 
			
		||||
        oled_set_cursor(0, 0);
 | 
			
		||||
        oled_task_user();
 | 
			
		||||
        oled_task_kb();
 | 
			
		||||
    }
 | 
			
		||||
#else
 | 
			
		||||
    oled_set_cursor(0, 0);
 | 
			
		||||
    oled_task_user();
 | 
			
		||||
    oled_task_kb();
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if OLED_SCROLL_TIMEOUT > 0
 | 
			
		||||
| 
						 | 
				
			
			@ -776,4 +777,5 @@ void oled_task(void) {
 | 
			
		|||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
__attribute__((weak)) void oled_task_user(void) {}
 | 
			
		||||
__attribute__((weak)) bool oled_task_kb(void) { return oled_task_user(); }
 | 
			
		||||
__attribute__((weak)) bool oled_task_user(void) { return true; }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue