diff options
| author | Bdale Garbee <bdale@gag.com> | 2014-06-15 17:47:41 -0600 |
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2014-06-15 17:47:41 -0600 |
| commit | c5cfc0d6e507d093987741b6ffaf69ebb24caa4b (patch) | |
| tree | a75b83343939e96592ac07178f2011d82ea6ded8 /src/cc1111/ao_usb.c | |
| parent | 1b3d07ede530fa40cb7257fb1725c969ba60e0f0 (diff) | |
| parent | 9ab3a1de95b705783c31a7e16447f52c10b6b480 (diff) | |
Merge branch 'branch-1.4' into debian
Diffstat (limited to 'src/cc1111/ao_usb.c')
| -rw-r--r-- | src/cc1111/ao_usb.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/cc1111/ao_usb.c b/src/cc1111/ao_usb.c index b0ab409d..d9d255f8 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) @@ -274,7 +274,7 @@ ao_usb_ep0_setup(void) ao_usb_ep0_in_len = ao_usb_setup.length; ao_usb_ep0_flush(); } else if (ao_usb_ep0_out_len) { - + /* Receiving data from the host */ ao_usb_ep0_state = AO_USB_EP0_DATA_OUT; @@ -448,6 +448,9 @@ ao_usb_enable(void) USBCIF = 0; USBOIF = 0; USBIIF = 0; +#if HAS_USB_PULLUP + ao_gpio_set(AO_USB_PULLUP_PORT, AO_USB_PULLUP_PIN, AO_USB_PULLUP, 0); +#endif } void @@ -459,6 +462,10 @@ ao_usb_disable(void) USBCIE = 0; IEN2 &= ~IEN2_USBIE; +#if HAS_USB_PULLUP + ao_gpio_set(AO_USB_PULLUP_PORT, AO_USB_PULLUP_PIN, AO_USB_PULLUP, 0); +#endif + /* Clear any pending interrupts */ USBCIF = 0; USBOIF = 0; @@ -471,6 +478,9 @@ ao_usb_disable(void) void ao_usb_init(void) { +#if HAS_USB_PULLUP + ao_enable_output(AO_USB_PULLUP_PORT, AO_USB_PULLUP_PIN, AO_USB_PULLUP, 0); +#endif ao_usb_enable(); ao_add_task(&ao_usb_task, ao_usb_ep0, "usb"); |
