From 9f6983e3d61fa5231f3d0ce33dbc5aadf946b597 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 18 Feb 2014 09:44:52 -0800 Subject: [PATCH] altos: Expose ao_usb_running globally This lets other bits of the code know when USB has been connected. Signed-off-by: Keith Packard --- src/avr/ao_usb_avr.c | 2 +- src/cc1111/ao_usb.c | 2 +- src/core/ao_usb.h | 2 ++ src/lpc/ao_usb_lpc.c | 2 +- src/stm/ao_usb_stm.c | 5 ++++- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/avr/ao_usb_avr.c b/src/avr/ao_usb_avr.c index bd75b17d..cb0455c2 100644 --- a/src/avr/ao_usb_avr.c +++ b/src/avr/ao_usb_avr.c @@ -46,7 +46,7 @@ static __xdata uint8_t ao_usb_ep0_out_len; static __xdata uint8_t *__xdata ao_usb_ep0_out_data; static __xdata uint8_t ao_usb_in_flushed; -static __xdata uint8_t ao_usb_running; +__xdata uint8_t ao_usb_running; static __xdata uint8_t ao_usb_configuration; static __xdata uint8_t ueienx_0; diff --git a/src/cc1111/ao_usb.c b/src/cc1111/ao_usb.c index b0ab409d..2141eda8 100644 --- a/src/cc1111/ao_usb.c +++ b/src/cc1111/ao_usb.c @@ -24,7 +24,7 @@ static __xdata uint16_t ao_usb_in_bytes; static __pdata uint16_t ao_usb_in_bytes_last; static __xdata uint16_t ao_usb_out_bytes; static __pdata uint8_t ao_usb_iif; -static __pdata uint8_t ao_usb_running; +__pdata uint8_t ao_usb_running; static void ao_usb_set_interrupts(void) diff --git a/src/core/ao_usb.h b/src/core/ao_usb.h index 35e64e65..1ce4f82f 100644 --- a/src/core/ao_usb.h +++ b/src/core/ao_usb.h @@ -137,4 +137,6 @@ struct ao_usb_line_coding { uint8_t data_bits; } ; +extern __pdata uint8_t ao_usb_running; + #endif /* _AO_USB_H_ */ diff --git a/src/lpc/ao_usb_lpc.c b/src/lpc/ao_usb_lpc.c index d02ccdd6..340413fa 100644 --- a/src/lpc/ao_usb_lpc.c +++ b/src/lpc/ao_usb_lpc.c @@ -109,7 +109,7 @@ static uint8_t ao_usb_in_pending; * but not pulled to the shadow buffer. */ static uint8_t ao_usb_out_avail; -static uint8_t ao_usb_running; +uint8_t ao_usb_running; static uint8_t ao_usb_configuration; #define AO_USB_EP0_GOT_RESET 1 diff --git a/src/stm/ao_usb_stm.c b/src/stm/ao_usb_stm.c index 27b82357..4e9d1f14 100644 --- a/src/stm/ao_usb_stm.c +++ b/src/stm/ao_usb_stm.c @@ -117,7 +117,7 @@ static uint8_t ao_usb_in_pending; * but not pulled to the shadow buffer. */ static uint8_t ao_usb_out_avail; -static uint8_t ao_usb_running; +uint8_t ao_usb_running; static uint8_t ao_usb_configuration; #define AO_USB_EP0_GOT_RESET 1 @@ -727,6 +727,9 @@ ao_usb_ep0_handle(uint8_t receive) if (receive & AO_USB_EP0_GOT_TX_ACK) { debug ("\tgot tx ack\n"); +#if HAS_FLIGHT && AO_USB_FORCE_IDLE + ao_flight_force_idle = 1; +#endif /* Wait until the IN packet is received from addr 0 * before assigning our local address */ -- 2.30.2