diff --git a/components/esp_system/port/soc/esp32s3/usb_console.c b/components/esp_system/port/soc/esp32s3/usb_console.c index 15b7f89ba5..31dbac2a7d 100644 --- a/components/esp_system/port/soc/esp32s3/usb_console.c +++ b/components/esp_system/port/soc/esp32s3/usb_console.c @@ -53,7 +53,7 @@ static esp_usb_console_cb_t s_tx_cb; static void *s_cb_arg; #ifdef CONFIG_ESP_CONSOLE_USB_CDC_SUPPORT_ETS_PRINTF -static spinlock_t s_write_lock = SPINLOCK_INITIALIZER; +static portMUX_TYPE s_write_lock = portMUX_INITIALIZER_UNLOCKED; void esp_usb_console_write_char(char c); #define ISR_FLAG ESP_INTR_FLAG_IRAM #else @@ -399,11 +399,11 @@ void esp_usb_console_write_char(char c) } static inline void write_lock_acquire(void) { - spinlock_acquire(&s_write_lock, SPINLOCK_WAIT_FOREVER); + portENTER_CRITICAL_SAFE(&s_write_lock); } static inline void write_lock_release(void) { - spinlock_release(&s_write_lock); + portEXIT_CRITICAL_SAFE(&s_write_lock); } #else // CONFIG_ESP_CONSOLE_USB_CDC_SUPPORT_ETS_PRINTF diff --git a/components/vfs/vfs_eventfd.c b/components/vfs/vfs_eventfd.c index cc1a1cbc0d..a4f088352b 100644 --- a/components/vfs/vfs_eventfd.c +++ b/components/vfs/vfs_eventfd.c @@ -61,7 +61,7 @@ typedef struct { event_select_args_t *select_args; _lock_t lock; // only for event fds that support ISR. - spinlock_t data_spin_lock; + portMUX_TYPE data_spin_lock; } event_context_t; esp_vfs_id_t s_eventfd_vfs_id = -1; @@ -421,7 +421,7 @@ int eventfd(unsigned int initval, int flags) fd = i; s_events[i].fd = i; s_events[i].support_isr = support_isr; - spinlock_initialize(&s_events[i].data_spin_lock); + portMUX_INITIALIZE(&s_events[i].data_spin_lock); if (support_isr) { portENTER_CRITICAL(&s_events[i].data_spin_lock);