1
0
Fork 0

Fix lufa sendchar() infinite wait loop

- FrameNumber is not updated when adapter powered
- can be blocked in sendchar() when pluged into AC adapter
This commit is contained in:
tmk 2014-11-29 20:47:15 +09:00
parent 9179246a1d
commit 20caf673d8
2 changed files with 20 additions and 19 deletions

View file

@ -17,8 +17,8 @@
static int8_t sendchar_func(uint8_t c)
{
sendchar(c); // LUFA
xmit(c); // SUART
sendchar(c); // LUFA
return 0;
}
@ -85,6 +85,7 @@ int main(void)
print("Keyboard start.\n");
while (1) {
while (USB_DeviceState == DEVICE_STATE_Suspended) {
print("[s]");
suspend_power_down();
if (USB_Device_RemoteWakeupEnabled && suspend_wakeup_condition()) {
USB_Device_SendRemoteWakeup();