summaryrefslogtreecommitdiff
path: root/keyboard/hhkb_rn42/rn42/main.c
diff options
context:
space:
mode:
authortmk <hasu@tmk-kbd.com>2015-01-15 17:12:26 +0900
committertmk <hasu@tmk-kbd.com>2015-01-15 17:12:26 +0900
commit65a2ce94a305f46c8f258e2f1613201a69bc8114 (patch)
treeacd515b6e5f9ab0f010bc5eac9ae9677f9bad618 /keyboard/hhkb_rn42/rn42/main.c
parent10a6b2c7d8bc9c5d2657acdeefa1102be5035280 (diff)
parent517817b9c7f00b180385c6bdf5310234185e5b98 (diff)
Merge branch 'rn42'
Diffstat (limited to 'keyboard/hhkb_rn42/rn42/main.c')
-rw-r--r--keyboard/hhkb_rn42/rn42/main.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/keyboard/hhkb_rn42/rn42/main.c b/keyboard/hhkb_rn42/rn42/main.c
index 43d887067d..83d9950388 100644
--- a/keyboard/hhkb_rn42/rn42/main.c
+++ b/keyboard/hhkb_rn42/rn42/main.c
@@ -17,8 +17,8 @@
static int8_t sendchar_func(uint8_t c)
{
- sendchar(c); // LUFA
xmit(c); // SUART
+ sendchar(c); // LUFA
return 0;
}
@@ -63,7 +63,7 @@ int main(void)
USB_USBTask();
#endif
}
- print("USB configured.\n");
+ print("\nUSB init\n");
rn42_init();
rn42_task_init();
@@ -82,10 +82,19 @@ int main(void)
sleep_led_init();
#endif
- print("Keyboard start.\n");
+ print("Keyboard start\n");
while (1) {
- while (USB_DeviceState == DEVICE_STATE_Suspended) {
- suspend_power_down(WDTO_120MS);
+ while (rn42_rts() && // RN42 is off
+ USB_DeviceState == DEVICE_STATE_Suspended) {
+ print("[s]");
+ matrix_power_down();
+ suspend_power_down();
+ suspend_power_down();
+ suspend_power_down();
+ suspend_power_down();
+ suspend_power_down();
+ suspend_power_down();
+ suspend_power_down();
if (USB_Device_RemoteWakeupEnabled && suspend_wakeup_condition()) {
USB_Device_SendRemoteWakeup();
}