summaryrefslogtreecommitdiffstats
path: root/keyboard
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2014-07-28 15:52:07 +0900
committertmk <nobody@nowhere>2014-07-30 14:38:27 +0900
commite4b95410416d98f9d9753a1ce21846256de7c8fa (patch)
tree1bec72001a4cad7c641068f552994e965bd27da1 /keyboard
parentf441ad07ccbb7ed0a6fbe7068f89aacd6dc6ff3d (diff)
Add connection indicator
Diffstat (limited to 'keyboard')
-rw-r--r--keyboard/hhkb_rn42/rn42/rn42_task.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/keyboard/hhkb_rn42/rn42/rn42_task.c b/keyboard/hhkb_rn42/rn42/rn42_task.c
index fd5a814b29..2813b1c5ff 100644
--- a/keyboard/hhkb_rn42/rn42/rn42_task.c
+++ b/keyboard/hhkb_rn42/rn42/rn42_task.c
@@ -58,10 +58,10 @@ static void battery_led(bool on)
{
if (on) {
DDRF |= (1<<5);
- PORTF &= ~(1<<5);
+ PORTF &= ~(1<<5); // Low
} else {
DDRF &= ~(1<<5);
- PORTF |= (1<<5);
+ PORTF &= ~(1<<5); // HiZ
}
}
@@ -80,9 +80,9 @@ void rn42_task_init(void)
{
battery_adc_init();
- // battery charging(input with pull-up)
+ // battery charging(HiZ)
DDRF &= ~(1<<5);
- PORTF |= (1<<5);
+ PORTF &= ~(1<<5);
}
void rn42_task(void)
@@ -135,6 +135,15 @@ void rn42_task(void)
host_set_driver(&lufa_driver);
}
}
+
+ /* Battery monitor */
+
+ /* Connection monitor */
+ if (rn42_linked()) {
+ status_led(true);
+ } else {
+ status_led(false);
+ }
}