kimera: Fix the error handling of reading matrix mapping
This commit is contained in:
parent
bcee04659b
commit
f9e449f7cf
@ -99,13 +99,16 @@ uint8_t read_matrix_mapping(void)
|
|||||||
uint8_t error = 0;
|
uint8_t error = 0;
|
||||||
|
|
||||||
/* read number of rows and cols */
|
/* read number of rows and cols */
|
||||||
row_count = eeprom_read_byte(EECONFIG_ROW_COUNT);
|
uint8_t rows = eeprom_read_byte(EECONFIG_ROW_COUNT);
|
||||||
col_count = eeprom_read_byte(EECONFIG_COL_COUNT);
|
uint8_t cols = eeprom_read_byte(EECONFIG_COL_COUNT);
|
||||||
if (row_count == 0) error++;
|
if (rows == 0) error++;
|
||||||
if (row_count == UNCONFIGURED) error++;
|
if (rows == UNCONFIGURED) error++;
|
||||||
if (col_count == 0) error++;
|
if (cols == 0) error++;
|
||||||
if (col_count == UNCONFIGURED) error++;
|
if (cols == UNCONFIGURED) error++;
|
||||||
if (row_count + col_count > PX_COUNT) error++;
|
if (rows + cols > PX_COUNT) error++;
|
||||||
|
if (error) return error;
|
||||||
|
row_count = rows;
|
||||||
|
col_count = cols;
|
||||||
|
|
||||||
/* read row mapping */
|
/* read row mapping */
|
||||||
uint8_t *mapping = EECONFIG_ROW_COL_MAPPING;
|
uint8_t *mapping = EECONFIG_ROW_COL_MAPPING;
|
||||||
|
Reference in New Issue
Block a user