From 3bb0586acc6472380365d78ee81a332aca468239 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Fri, 16 Jun 2017 23:50:44 +0300 Subject: Add a couple of basic tests and implement driver mock --- tests/test_common/matrix.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tests/test_common/matrix.c') diff --git a/tests/test_common/matrix.c b/tests/test_common/matrix.c index 940f28f35..85556e2c4 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); +} -- cgit v1.2.3