From ae28b16fc630cc8219676f1bfb9cee41f0b36a79 Mon Sep 17 00:00:00 2001 From: tmk Date: Mon, 28 Jul 2014 11:56:02 +0900 Subject: Add battery monitor and LED control --- keyboard/hhkb_rn42/rn42/rn42_task.c | 46 ++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'keyboard/hhkb_rn42/rn42') diff --git a/keyboard/hhkb_rn42/rn42/rn42_task.c b/keyboard/hhkb_rn42/rn42/rn42_task.c index 437dd46f49..fd5a814b29 100644 --- a/keyboard/hhkb_rn42/rn42/rn42_task.c +++ b/keyboard/hhkb_rn42/rn42/rn42_task.c @@ -13,6 +13,17 @@ static bool config_mode = false; static bool force_usb = false; +static void status_led(bool on) +{ + if (on) { + DDRE |= (1<<6); + PORTE &= ~(1<<6); + } else { + DDRE |= (1<<6); + PORTE |= (1<<6); + } +} + static void battery_adc_init(void) { ADMUX = (1<