diff options
author | tmk <nobody@nowhere> | 2014-08-30 15:59:41 +0900 |
---|---|---|
committer | tmk <nobody@nowhere> | 2014-08-30 15:59:41 +0900 |
commit | 807ed33a9a29ee3c5248226d0e865d0580d7eebc (patch) | |
tree | 14e0fdca30b6163b01c868690436225762a5a315 | |
parent | 28c1bf294c223f3a93ec7ee2420ada7f1e27fba0 (diff) |
Fix rn42_linked() to use pullup
-rw-r--r-- | keyboard/hhkb_rn42/rn42/rn42.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/keyboard/hhkb_rn42/rn42/rn42.c b/keyboard/hhkb_rn42/rn42/rn42.c index 556c61af95..bdffad7667 100644 --- a/keyboard/hhkb_rn42/rn42/rn42.c +++ b/keyboard/hhkb_rn42/rn42/rn42.c @@ -34,7 +34,7 @@ void rn42_init(void) // PF6: linked(input without pull-up) DDRF &= ~(1<<6); - PORTF &= ~(1<<6); + PORTF |= (1<<6); // PF1: RTS(low: allowed to send, high: not allowed) DDRF &= ~(1<<1); @@ -93,7 +93,11 @@ void rn42_cts_lo(void) bool rn42_linked(void) { - return PINF&(1<<6); + // RN-42 GPIO2 + // Hi-Z: Not powered + // High: Linked + // Low: Connecting + return !rn42_rts() && PINF&(1<<6); } |