summaryrefslogtreecommitdiff
path: root/common/keyboard.c
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2012-11-23 13:22:53 +0900
committertmk <nobody@nowhere>2012-11-23 13:22:53 +0900
commit83f0e800e53a6d91a814d19f94bc5401a6322971 (patch)
tree5fa8d975415232a0d23e249c047f014cb21b5c4b /common/keyboard.c
parent38effe4ae4a691dcf034c31f67d1bdb2156ba7f5 (diff)
parent3f47bcbcae2249dff01f84b9b583ead0d9f2308d (diff)
Merge branch 'phantom'
Diffstat (limited to 'common/keyboard.c')
-rw-r--r--common/keyboard.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/common/keyboard.c b/common/keyboard.c
index fa22116f17..cd1ceb420c 100644
--- a/common/keyboard.c
+++ b/common/keyboard.c
@@ -564,20 +564,20 @@ void keyboard_task(void)
matrix_row_t matrix_change = 0;
matrix_scan();
- for (int r = 0; r < MATRIX_ROWS; r++) {
+ for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
matrix_row = matrix_get_row(r);
matrix_change = matrix_row ^ matrix_prev[r];
if (matrix_change) {
if (debug_matrix) matrix_print();
- for (int c = 0; c < MATRIX_COLS; c++) {
- if (matrix_change & (1<<c)) {
+ for (uint8_t c = 0; c < MATRIX_COLS; c++) {
+ if (matrix_change & ((matrix_row_t)1<<c)) {
process_key((keyevent_t){
.key = (key_t){ .row = r, .col = c },
- .pressed = (matrix_row & (1<<c))
+ .pressed = (matrix_row & ((matrix_row_t)1<<c))
});
// record a processed key
- matrix_prev[r] ^= (1<<c);
+ matrix_prev[r] ^= ((matrix_row_t)1<<c);
// process a key per task call
goto MATRIX_LOOP_END;
}