From: tmk Date: Mon, 28 Jul 2014 02:56:02 +0000 (+0900) Subject: Add battery monitor and LED control X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=ae28b16fc630cc8219676f1bfb9cee41f0b36a79;p=max%2Ftmk_keyboard.git Add battery monitor and LED control --- diff --git a/keyboard/hhkb_rn42/rn42/rn42_task.c b/keyboard/hhkb_rn42/rn42/rn42_task.c index 437dd46f..fd5a814b 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<