summaryrefslogtreecommitdiff
path: root/class
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2022-03-17 16:40:54 +0800
committersakumisu <[email protected]>2022-03-17 16:40:54 +0800
commitfd574baeb728f2da39b5b2ea366f12b23bd4db59 (patch)
treea679bb7be21731ef3b87a39e9933c14e4245e674 /class
parent080ebc729731e10da769af7f81f38b0ee24403d5 (diff)
fix critical section wrong use
Diffstat (limited to 'class')
-rw-r--r--class/hub/usbh_hub.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/class/hub/usbh_hub.c b/class/hub/usbh_hub.c
index 76642cb0..69b75dd2 100644
--- a/class/hub/usbh_hub.c
+++ b/class/hub/usbh_hub.c
@@ -29,7 +29,7 @@ static uint32_t g_devinuse = 0;
usb_slist_t hub_class_head = USB_SLIST_OBJECT_INIT(hub_class_head);
-USB_NOCACHE_RAM_SECTION uint8_t int_buffer[6][USBH_HUB_INTIN_BUFSIZE];
+USB_MEM_ALIGN32 uint8_t int_buffer[6][USBH_HUB_INTIN_BUFSIZE];
extern void usbh_external_hport_connect(struct usbh_hubport *hport);
extern void usbh_external_hport_disconnect(struct usbh_hubport *hport);
extern void usbh_hport_activate(struct usbh_hubport *hport);
@@ -326,7 +326,6 @@ static void usbh_extern_hub_psc_event(void *arg)
uint16_t change;
uint16_t mask;
uint16_t feat;
- uint32_t flags;
int ret;
hub_class = (struct usbh_hub *)arg;
@@ -484,11 +483,10 @@ static void usbh_extern_hub_psc_event(void *arg)
/* Hub status changed */
USB_LOG_WRN("Hub status changed, not handled\n");
}
- flags = usb_osal_enter_critical_section();
+
if (hub_class->parent->connected) {
ret = usbh_ep_intr_async_transfer(hub_class->intin, hub_class->int_buffer, USBH_HUB_INTIN_BUFSIZE, usbh_external_hub_callback, hub_class);
}
- usb_osal_leave_critical_section(flags);
}
static void usbh_external_hub_callback(void *arg, int nbytes)