forked from espressif/esp-idf
fix(heap): use _SAFE version of critical section
because we allow to call malloc and free in an ISR context
This commit is contained in:
@@ -19,14 +19,14 @@ typedef portMUX_TYPE multi_heap_lock_t;
|
|||||||
we need to use portmux spinlocks here not RTOS mutexes */
|
we need to use portmux spinlocks here not RTOS mutexes */
|
||||||
#define MULTI_HEAP_LOCK(PLOCK) do { \
|
#define MULTI_HEAP_LOCK(PLOCK) do { \
|
||||||
if((PLOCK) != NULL) { \
|
if((PLOCK) != NULL) { \
|
||||||
portENTER_CRITICAL((PLOCK)); \
|
portENTER_CRITICAL_SAFE((PLOCK)); \
|
||||||
} \
|
} \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
|
|
||||||
#define MULTI_HEAP_UNLOCK(PLOCK) do { \
|
#define MULTI_HEAP_UNLOCK(PLOCK) do { \
|
||||||
if ((PLOCK) != NULL) { \
|
if ((PLOCK) != NULL) { \
|
||||||
portEXIT_CRITICAL((PLOCK)); \
|
portEXIT_CRITICAL_SAFE((PLOCK)); \
|
||||||
} \
|
} \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user