summaryrefslogtreecommitdiff
path: root/hhkb/matrix.c
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2011-01-02 23:52:13 +0900
committertmk <nobody@nowhere>2011-01-02 23:52:13 +0900
commit2a562a4191a5b9e88731efb5eabd921821f25f7e (patch)
tree20f5bb311ff99ced3dd8ee2d9430e2fbe8183f7b /hhkb/matrix.c
parent1ed336a06499c1baee2421141d59d115f0ee3c4b (diff)
Add PS/2 mouse support to connect TrackPoint Unit.
Change build options: Makefile and config.h. See README.
Diffstat (limited to 'hhkb/matrix.c')
-rw-r--r--hhkb/matrix.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hhkb/matrix.c b/hhkb/matrix.c
index a6e0bf633f..dd4440d9e3 100644
--- a/hhkb/matrix.c
+++ b/hhkb/matrix.c
@@ -7,7 +7,6 @@
#include <util/delay.h>
#include "print.h"
#include "util.h"
-#include "controller.h"
#include "matrix_skel.h"
// matrix is active low. (key on: 0/key off: 1)
@@ -22,7 +21,7 @@
// KEY_PREV: (on: 1/ off: 0)
// PE6,PE7(KEY, KEY_PREV)
#define COL_ENABLE (1<<6)
-#define KEY_SELELCT(ROW, COL) (PORTB = COL_ENABLE|(((COL)&0x07)<<3)|((ROW)&0x07))
+#define KEY_SELELCT(ROW, COL) (PORTB = (PORTB&(1<<7))|COL_ENABLE|(((COL)&0x07)<<3)|((ROW)&0x07))
#define KEY_ENABLE (PORTB &= ~COL_ENABLE)
#define KEY_UNABLE (PORTB |= COL_ENABLE)
#define KEY_STATE (PINE&(1<<6))
@@ -53,7 +52,7 @@ void matrix_init(void)
{
// row & col output(PB0-6)
DDRB = 0xFF;
- PORTB = KEY_SELELCT(0, 0);
+ KEY_SELELCT(0, 0);
// KEY: input with pullup(PE6)
// KEY_PREV: output(PE7)
DDRE = 0xBF;