summaryrefslogtreecommitdiff
path: root/src/lpc/ao_usb_lpc.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-05-19 20:27:53 -0700
committerKeith Packard <keithp@keithp.com>2013-05-19 20:39:19 -0700
commit35b120c4154df0351c3a802f86dda224a7643068 (patch)
treea2d773fa1e5bc6c94c1d256586e004b2ffb455ae /src/lpc/ao_usb_lpc.c
parentc1f01cd4406063191a51cb68fc4634eabfc60fc2 (diff)
altos/lpc: Force idle mode if USB gets an address during boot time
This lets EasyMini be booted to idle mode by simply plugging it into USB. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/lpc/ao_usb_lpc.c')
-rw-r--r--src/lpc/ao_usb_lpc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lpc/ao_usb_lpc.c b/src/lpc/ao_usb_lpc.c
index 8070acc3..aac0df04 100644
--- a/src/lpc/ao_usb_lpc.c
+++ b/src/lpc/ao_usb_lpc.c
@@ -605,8 +605,14 @@ ao_usb_ep0_handle(uint8_t receive)
/* Wait until the IN packet is received from addr 0
* before assigning our local address
*/
- if (ao_usb_address_pending)
+ if (ao_usb_address_pending) {
+#if HAS_FLIGHT
+ /* Go to idle mode if USB is connected
+ */
+ ao_flight_force_idle = 1;
+#endif
ao_usb_set_address(ao_usb_address);
+ }
if (ao_usb_ep0_state == AO_USB_EP0_DATA_IN)
ao_usb_ep0_flush();
}