Add keyboard_setup() and matrix_setup()
This commit is contained in:
		
							parent
							
								
									9a2282157f
								
							
						
					
					
						commit
						6b588eb7f7
					
				
					 6 changed files with 25 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -85,6 +85,8 @@ void suspend_power_down(void)
 | 
			
		|||
    power_down(WDTO_15MS);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
__attribute__ ((weak)) void matrix_power_up(void) {}
 | 
			
		||||
__attribute__ ((weak)) void matrix_power_down(void) {}
 | 
			
		||||
bool suspend_wakeup_condition(void)
 | 
			
		||||
{
 | 
			
		||||
    matrix_power_up();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -62,6 +62,12 @@ static bool has_ghost_in_row(uint8_t row)
 | 
			
		|||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
__attribute__ ((weak)) void matrix_setup(void) {}
 | 
			
		||||
void keyboard_setup(void)
 | 
			
		||||
{
 | 
			
		||||
    matrix_setup();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void keyboard_init(void)
 | 
			
		||||
{
 | 
			
		||||
    timer_init();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -58,13 +58,15 @@ static inline bool IS_RELEASED(keyevent_t event) { return (!IS_NOEVENT(event) &&
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* it runs once at early stage of startup before keyboard_init. */
 | 
			
		||||
void keyboard_setup(void);
 | 
			
		||||
/* it runs once after initializing host side protocol, debug and MCU peripherals. */
 | 
			
		||||
void keyboard_init(void);
 | 
			
		||||
/* it runs repeatedly in main loop */
 | 
			
		||||
void keyboard_task(void);
 | 
			
		||||
/* it runs when host LED status is updated */
 | 
			
		||||
void keyboard_set_leds(uint8_t leds);
 | 
			
		||||
 | 
			
		||||
__attribute__ ((weak)) void matrix_power_up(void) {}
 | 
			
		||||
__attribute__ ((weak)) void matrix_power_down(void) {}
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -43,7 +43,9 @@ extern "C" {
 | 
			
		|||
uint8_t matrix_rows(void);
 | 
			
		||||
/* number of matrix columns */
 | 
			
		||||
uint8_t matrix_cols(void);
 | 
			
		||||
/* intialize matrix for scaning. should be called once. */
 | 
			
		||||
/* should be called at early stage of startup before matrix_init.(optional) */
 | 
			
		||||
void matrix_setup(void);
 | 
			
		||||
/* intialize matrix for scaning. */
 | 
			
		||||
void matrix_init(void);
 | 
			
		||||
/* scan all key states on matrix */
 | 
			
		||||
uint8_t matrix_scan(void);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue