summaryrefslogtreecommitdiffstats
path: root/app/kvm.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/kvm.c')
-rw-r--r--app/kvm.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/app/kvm.c b/app/kvm.c
index ab27bb7..a4c3024 100644
--- a/app/kvm.c
+++ b/app/kvm.c
@@ -26,13 +26,21 @@ kvm_dispatch (void)
addr, endpoint, len, buf[0], buf[1], buf[2], buf[3]);
#endif
- if (len) {
- if (endpoint==0x81)
- led_set(GPIO8);
- else
- led_set(GPIO9);
- usbd_ep_write_packet (usbd_dev, endpoint, buf, len);
- }
+ if (len)
+ {
+ if (endpoint == 0x81)
+ {
+ usb_wakeup_host ();
+ led_set (GPIO8);
+ }
+ else
+ {
+ led_set (GPIO9);
+ }
+
+ if (!usb_is_suspended)
+ usbd_ep_write_packet (usbd_dev, endpoint, buf, len);
+ }
}
void
@@ -89,12 +97,12 @@ kvm_recv (uint8_t d)
buf[ptr++] = d;
if (ptr >= len)
{
- if (addr==BUS_ID)
+ if (addr == BUS_ID)
kvm_dispatch ();
state = STATE_SYNC;
}
break;
default:
- break;
+ break;
}
}