aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
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 {