mirror of
				https://github.com/mfulz/qmk_firmware.git
				synced 2025-10-31 05:12:33 +01:00 
			
		
		
		
	[Core] Fix bug and code regression for Split Common (#15603)
This commit is contained in:
		
							parent
							
								
									2689e360ce
								
							
						
					
					
						commit
						c86baf3ece
					
				| @ -95,24 +95,22 @@ uint8_t matrix_key_count(void) { | |||||||
| bool matrix_post_scan(void) { | bool matrix_post_scan(void) { | ||||||
|     bool changed = false; |     bool changed = false; | ||||||
|     if (is_keyboard_master()) { |     if (is_keyboard_master()) { | ||||||
|  |         static bool  last_connected              = false; | ||||||
|         matrix_row_t slave_matrix[ROWS_PER_HAND] = {0}; |         matrix_row_t slave_matrix[ROWS_PER_HAND] = {0}; | ||||||
|         if (transport_master_if_connected(matrix + thisHand, slave_matrix)) { |         if (transport_master_if_connected(matrix + thisHand, slave_matrix)) { | ||||||
|             for (int i = 0; i < ROWS_PER_HAND; ++i) { |             changed = memcmp(matrix + thatHand, slave_matrix, sizeof(slave_matrix)) != 0; | ||||||
|                 if (matrix[thatHand + i] != slave_matrix[i]) { |  | ||||||
|                     matrix[thatHand + i] = slave_matrix[i]; |  | ||||||
|                     changed              = true; |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|         } else { |  | ||||||
|             // reset other half if disconnected
 |  | ||||||
|             for (int i = 0; i < ROWS_PER_HAND; ++i) { |  | ||||||
|                 matrix[thatHand + i] = 0; |  | ||||||
|                 slave_matrix[i]      = 0; |  | ||||||
|             } |  | ||||||
| 
 | 
 | ||||||
|  |             last_connected = true; | ||||||
|  |         } else if (last_connected) { | ||||||
|  |             // reset other half when disconnected
 | ||||||
|  |             memset(slave_matrix, 0, sizeof(slave_matrix)); | ||||||
|             changed = true; |             changed = true; | ||||||
|  | 
 | ||||||
|  |             last_connected = false; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |         if (changed) memcpy(matrix + thatHand, slave_matrix, sizeof(slave_matrix)); | ||||||
|  | 
 | ||||||
|         matrix_scan_quantum(); |         matrix_scan_quantum(); | ||||||
|     } else { |     } else { | ||||||
|         transport_slave(matrix + thatHand, matrix + thisHand); |         transport_slave(matrix + thatHand, matrix + thisHand); | ||||||
|  | |||||||
| @ -2,7 +2,6 @@ | |||||||
| 
 | 
 | ||||||
| #include <stdbool.h> | #include <stdbool.h> | ||||||
| #include <stdint.h> | #include <stdint.h> | ||||||
| #include <stdio.h> |  | ||||||
| #include <stdlib.h> | #include <stdlib.h> | ||||||
| 
 | 
 | ||||||
| #include "matrix.h" | #include "matrix.h" | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Drashna Jaelre
						Drashna Jaelre