freertos/port: Put critical sections around uxPortCompareSetExtram() to prevent preemption during its execution.

Closes: https://github.com/espressif/esp-idf/issues/4561
pull/4623/head
Felipe Neves 2020-01-07 10:46:59 -03:00
rodzic 71b4768df8
commit 9800750f15
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -443,6 +443,9 @@ static portMUX_TYPE extram_mux = portMUX_INITIALIZER_UNLOCKED;
void uxPortCompareSetExtram(volatile uint32_t *addr, uint32_t compare, uint32_t *set) {
uint32_t prev;
uint32_t oldlevel = portENTER_CRITICAL_NESTED();
#ifdef CONFIG_FREERTOS_PORTMUX_DEBUG
vPortCPUAcquireMutexIntsDisabled(&extram_mux, portMUX_NO_TIMEOUT, __FUNCTION__, __LINE__);
#else
@ -458,6 +461,8 @@ void uxPortCompareSetExtram(volatile uint32_t *addr, uint32_t compare, uint32_t
#else
vPortCPUReleaseMutexIntsDisabled(&extram_mux);
#endif
portEXIT_CRITICAL_NESTED(oldlevel);
}
#endif //defined(CONFIG_SPIRAM)