mirror of
				https://github.com/mfulz/qmk_firmware.git
				synced 2025-10-30 21:02:32 +01:00 
			
		
		
		
	Reset matrix_need_update properly in eager debouncing algorithms (#21154)
				
					
				
			The `matrix_need_update` variable needs to be reset to `false` in `transfer_matrix_values()`, otherwise that function continues to be invoked for every scanning loop (forever with `sym_eager_pk` and `sym_eager_pk`, or until some key gets released with `asym_eager_defer_pk`), and the scanning rate gets much lower because of all that useless work. Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
This commit is contained in:
		
							parent
							
								
									a059d121fa
								
							
						
					
					
						commit
						90ea9e447a
					
				| @ -144,6 +144,8 @@ static void update_debounce_counters_and_transfer_if_expired(matrix_row_t raw[], | |||||||
| static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows) { | static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows) { | ||||||
|     debounce_counter_t *debounce_pointer = debounce_counters; |     debounce_counter_t *debounce_pointer = debounce_counters; | ||||||
| 
 | 
 | ||||||
|  |     matrix_need_update = false; | ||||||
|  | 
 | ||||||
|     for (uint8_t row = 0; row < num_rows; row++) { |     for (uint8_t row = 0; row < num_rows; row++) { | ||||||
|         matrix_row_t delta = raw[row] ^ cooked[row]; |         matrix_row_t delta = raw[row] ^ cooked[row]; | ||||||
|         for (uint8_t col = 0; col < MATRIX_COLS; col++) { |         for (uint8_t col = 0; col < MATRIX_COLS; col++) { | ||||||
|  | |||||||
| @ -125,6 +125,7 @@ static void update_debounce_counters(uint8_t num_rows, uint8_t elapsed_time) { | |||||||
| 
 | 
 | ||||||
| // upload from raw_matrix to final matrix;
 | // upload from raw_matrix to final matrix;
 | ||||||
| static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows) { | static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows) { | ||||||
|  |     matrix_need_update                   = false; | ||||||
|     debounce_counter_t *debounce_pointer = debounce_counters; |     debounce_counter_t *debounce_pointer = debounce_counters; | ||||||
|     for (uint8_t row = 0; row < num_rows; row++) { |     for (uint8_t row = 0; row < num_rows; row++) { | ||||||
|         matrix_row_t delta        = raw[row] ^ cooked[row]; |         matrix_row_t delta        = raw[row] ^ cooked[row]; | ||||||
|  | |||||||
| @ -119,6 +119,7 @@ static void update_debounce_counters(uint8_t num_rows, uint8_t elapsed_time) { | |||||||
| 
 | 
 | ||||||
| // upload from raw_matrix to final matrix;
 | // upload from raw_matrix to final matrix;
 | ||||||
| static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows) { | static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows) { | ||||||
|  |     matrix_need_update                   = false; | ||||||
|     debounce_counter_t *debounce_pointer = debounce_counters; |     debounce_counter_t *debounce_pointer = debounce_counters; | ||||||
|     for (uint8_t row = 0; row < num_rows; row++) { |     for (uint8_t row = 0; row < num_rows; row++) { | ||||||
|         matrix_row_t existing_row = cooked[row]; |         matrix_row_t existing_row = cooked[row]; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 dexter93
						dexter93