From: tmk Date: Mon, 28 Jul 2014 02:56:02 +0000 (+0900) Subject: Add battery monitor and LED control X-Git-Url: https://git.donarmstrong.com/?p=tmk_firmware.git;a=commitdiff_plain;h=ae28b16fc630cc8219676f1bfb9cee41f0b36a79 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 437dd46..fd5a814 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<