Additional optimization, reach speed 368 scans/second

This commit is contained in:
Oleg Kostyuk 2013-09-16 05:21:44 +03:00
parent a84df046df
commit d30fba8ce2

View file

@ -146,7 +146,6 @@ uint8_t matrix_scan(void)
for (uint8_t i = 0; i < MATRIX_ROWS; i++) { for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
select_row(i); select_row(i);
_delay_us(30); // without this wait read unstable value.
matrix_row_t cols = read_cols(i); matrix_row_t cols = read_cols(i);
if (matrix_debouncing[i] != cols) { if (matrix_debouncing[i] != cols) {
matrix_debouncing[i] = cols; matrix_debouncing[i] = cols;
@ -246,6 +245,7 @@ static matrix_row_t read_cols(uint8_t row)
return data; return data;
} }
} else { } else {
_delay_us(30); // without this wait read unstable value.
// read from teensy // read from teensy
return return
(PINF&(1<<0) ? 0 : (1<<0)) | (PINF&(1<<0) ? 0 : (1<<0)) |