altos: Expose ao_usb_running globally
authorKeith Packard <keithp@keithp.com>
Tue, 18 Feb 2014 17:44:52 +0000 (09:44 -0800)
committerKeith Packard <keithp@keithp.com>
Tue, 18 Feb 2014 17:44:52 +0000 (09:44 -0800)
This lets other bits of the code know when USB has been connected.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/avr/ao_usb_avr.c
src/cc1111/ao_usb.c
src/core/ao_usb.h
src/lpc/ao_usb_lpc.c
src/stm/ao_usb_stm.c

index bd75b17d7a5cc21638ea2d02c81b04019525a8ad..cb0455c2d1ac6886bad4846c8d0184ed2efeaf00 100644 (file)
@@ -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;
 
index b0ab409d7e72d96bbce7c3aba51231d13771ae89..2141eda8dd9bba1b52412fe27cd3d4ffbf1bc7f1 100644 (file)
@@ -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)
index 35e64e655d92297c72fd36b070c59fb351621621..1ce4f82f2a1066d24f6276c0149501a47e569a3a 100644 (file)
@@ -137,4 +137,6 @@ struct ao_usb_line_coding {
        uint8_t         data_bits;
 } ;
 
+extern __pdata uint8_t ao_usb_running;
+
 #endif /* _AO_USB_H_ */
index d02ccdd6a5cbe06ab4ab74f951765b9e66dd0f73..340413fa4f7309f3b1b987238f6b0da2c9f59e17 100644 (file)
@@ -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
index 27b82357843d3d278b815165b99ecfdc97555f2a..4e9d1f145cd98001e4378d3f8ea12050fc034e91 100644 (file)
@@ -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
                 */