From a24a45fce71462bd80ef02fe049b16b68720d751 Mon Sep 17 00:00:00 2001 From: Ben Blazak Date: Fri, 6 Apr 2012 00:19:57 -0700 Subject: [PATCH] wrote teensy update() (need to test); minor mcp23018 update() fix --- src/keyboard/ergodox/mcp23018.c | 9 +++++- src/keyboard/ergodox/teensy-2-0.c | 52 +++++++++++++++++++++++++++++-- src/keyboard/ergodox/teensy-2-0.h | 2 ++ 3 files changed, 59 insertions(+), 4 deletions(-) diff --git a/src/keyboard/ergodox/mcp23018.c b/src/keyboard/ergodox/mcp23018.c index a1de01f..62f224e 100644 --- a/src/keyboard/ergodox/mcp23018.c +++ b/src/keyboard/ergodox/mcp23018.c @@ -108,10 +108,11 @@ uint8_t mcp23018_update_matrix(uint8_t matrix[KB_ROWS][KB_COLUMNS]) { for (uint8_t row=0x6; row<=0xB; row++) { // set row low : 0 + // set other rows high : 1 twi_start(); twi_send(TWI_ADDR_WRITE); twi_send(GPIOA); - twi_send( 0b00111111 & ~(1<<(row-6)) ); // GPIOA + twi_send( 0b11111111 & ~(1<<(row-6)) ); // GPIOA // get column data twi_start(); @@ -123,6 +124,12 @@ uint8_t mcp23018_update_matrix(uint8_t matrix[KB_ROWS][KB_COLUMNS]) { matrix[row][col] = !( data & (1<