diff options
author | Fred Sundvik <fsundvik@gmail.com> | 2017-06-16 23:50:44 +0300 |
---|---|---|
committer | Fred Sundvik <fsundvik@gmail.com> | 2017-06-18 21:22:22 +0300 |
commit | 3bb0586acc6472380365d78ee81a332aca468239 (patch) | |
tree | d8b4e194d9f39216e53e9aaa4b944679dfa567f3 /tests/test_common/matrix.c | |
parent | 617578399cf1a0fff70ceeb21d63a06524c801a3 (diff) |
Add a couple of basic tests and implement driver mock
Diffstat (limited to 'tests/test_common/matrix.c')
-rw-r--r-- | tests/test_common/matrix.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/test_common/matrix.c b/tests/test_common/matrix.c index 940f28f35b..85556e2c48 100644 --- a/tests/test_common/matrix.c +++ b/tests/test_common/matrix.c @@ -16,6 +16,9 @@ #include "matrix.h" +#include "test_matrix.h" + +static matrix_row_t matrix[MATRIX_ROWS] = {}; void matrix_init(void) { matrix_init_quantum(); @@ -27,7 +30,7 @@ uint8_t matrix_scan(void) { } matrix_row_t matrix_get_row(uint8_t row) { - return 0; + return matrix[row]; } void matrix_print(void) { @@ -41,3 +44,11 @@ void matrix_init_kb(void) { void matrix_scan_kb(void) { } + +void press_key(uint8_t col, uint8_t row) { + matrix[row] |= 1 << col; +} + +void release_key(uint8_t col, uint8_t row) { + matrix[row] &= ~(1 << col); +} |