multi_heap: use portENTER/EXIT_CRITICAL instead of taskENTER/EXIT_CRITICAL

This commit is contained in:
Ivan Grokhotkov
2018-01-29 21:41:58 +08:00
committed by Mahavir Jain
parent f65870566a
commit 573ea385b4
2 changed files with 10 additions and 11 deletions

View File

@@ -16,7 +16,6 @@
#ifdef ESP_PLATFORM
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <rom/ets_sys.h>
#include <assert.h>
@@ -24,14 +23,14 @@
we need to use portmux spinlocks here not RTOS mutexes */
#define MULTI_HEAP_LOCK(PLOCK) do { \
if((PLOCK) != NULL) { \
taskENTER_CRITICAL((portMUX_TYPE *)(PLOCK)); \
portENTER_CRITICAL((portMUX_TYPE *)(PLOCK)); \
} \
} while(0)
#define MULTI_HEAP_UNLOCK(PLOCK) do { \
if ((PLOCK) != NULL) { \
taskEXIT_CRITICAL((portMUX_TYPE *)(PLOCK)); \
portEXIT_CRITICAL((portMUX_TYPE *)(PLOCK)); \
} \
} while(0)