summaryrefslogtreecommitdiff
path: root/keyboard/hhkb_rn42/rn42/main.c
diff options
context:
space:
mode:
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();
}