Merge branch 'bugfix/usb_console_critical_section' into 'master'

esp_system: fix incorrect critical section usage in usb_console

Closes IDF-2049

See merge request espressif/esp-idf!10826
This commit is contained in:
Angus Gratton 2020-10-15 10:36:57 +08:00
commit 466ad65cf4

View File

@ -62,7 +62,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
@ -407,11 +407,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