aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-09-08 13:36:30 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-09-08 13:36:30 +0000
commit98bb7fb5df434b95253c5949444ee2dcff3a53b3 (patch)
tree8a2e66cf00718d14da5bbd4e1f6b446612cd08f0 /os
parente5833b6a09786844ae09f389d768accec9678026 (diff)
downloadChibiOS-98bb7fb5df434b95253c5949444ee2dcff3a53b3.tar.gz
ChibiOS-98bb7fb5df434b95253c5949444ee2dcff3a53b3.tar.bz2
ChibiOS-98bb7fb5df434b95253c5949444ee2dcff3a53b3.zip
Update USB demos with latest changes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8288 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/hal/ports/STM32/LLD/OTGv1/usb_lld.c4
-rw-r--r--os/hal/ports/STM32/LLD/USBv1/usb_lld.c10
2 files changed, 8 insertions, 6 deletions
diff --git a/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c b/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c
index b6d2f1cdd..6d8e01538 100644
--- a/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c
+++ b/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c
@@ -320,7 +320,7 @@ static void otg_fifo_read_to_buffer(volatile uint32_t *fifop,
uint8_t *buf,
size_t n,
size_t max) {
- uint32_t w;
+ uint32_t w = 0;
size_t i;
i = 0;
@@ -348,7 +348,7 @@ static void otg_fifo_read_to_buffer(volatile uint32_t *fifop,
static void otg_fifo_read_to_queue(volatile uint32_t *fifop,
input_queue_t *iqp,
size_t n) {
- uint32_t w;
+ uint32_t w = 0;
size_t i;
i = 0;
diff --git a/os/hal/ports/STM32/LLD/USBv1/usb_lld.c b/os/hal/ports/STM32/LLD/USBv1/usb_lld.c
index 19369892e..c6ccc16da 100644
--- a/os/hal/ports/STM32/LLD/USBv1/usb_lld.c
+++ b/os/hal/ports/STM32/LLD/USBv1/usb_lld.c
@@ -316,19 +316,20 @@ OSAL_IRQ_HANDLER(STM32_USB1_LP_HANDLER) {
/* USB bus reset condition handling.*/
if (istr & ISTR_RESET) {
- _usb_reset(usbp);
- _usb_isr_invoke_event_cb(usbp, USB_EVENT_RESET);
STM32_USB->ISTR = ~ISTR_RESET;
+
+ _usb_reset(usbp);
}
/* USB bus SUSPEND condition handling.*/
if (istr & ISTR_SUSP) {
STM32_USB->CNTR |= CNTR_FSUSP;
- _usb_isr_invoke_event_cb(usbp, USB_EVENT_SUSPEND);
#if STM32_USB_LOW_POWER_ON_SUSPEND
STM32_USB->CNTR |= CNTR_LP_MODE;
#endif
STM32_USB->ISTR = ~ISTR_SUSP;
+
+ _usb_suspend(usbp);
}
/* USB bus WAKEUP condition handling.*/
@@ -336,7 +337,8 @@ OSAL_IRQ_HANDLER(STM32_USB1_LP_HANDLER) {
uint32_t fnr = STM32_USB->FNR;
if (!(fnr & FNR_RXDP)) {
STM32_USB->CNTR &= ~CNTR_FSUSP;
- _usb_isr_invoke_event_cb(usbp, USB_EVENT_WAKEUP);
+
+ _usb_wakeup(usbp);
}
#if STM32_USB_LOW_POWER_ON_SUSPEND
else {