From: Mahavir Jain <mahavir@espressif.com>
Date: Mon, 11 Jun 2018 08:36:32 +0000 (+0530)
Subject: freertos: make task{ENTER/EXIT} macros deprecated for external use
X-Git-Tag: v3.1-beta1~30^2
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e43c920d882eae61879417efaa1e22acba20260;p=esp-idf

freertos: make task{ENTER/EXIT} macros deprecated for external use

Signed-off-by: Mahavir Jain <mahavir@espressif.com>
---

diff --git a/components/freertos/component.mk b/components/freertos/component.mk
index 7841d8f694..a10f84d800 100644
--- a/components/freertos/component.mk
+++ b/components/freertos/component.mk
@@ -5,3 +5,5 @@
 COMPONENT_ADD_LDFLAGS += -Wl,--undefined=uxTopUsedPriority
 COMPONENT_ADD_INCLUDEDIRS := include
 COMPONENT_PRIV_INCLUDEDIRS := include/freertos
+
+tasks.o event_groups.o timers.o queue.o ringbuf.o: CFLAGS += -D_ESP_FREERTOS_INTERNAL
diff --git a/components/freertos/include/freertos/task.h b/components/freertos/include/freertos/task.h
index 5af62c69c6..ab605bb301 100644
--- a/components/freertos/include/freertos/task.h
+++ b/components/freertos/include/freertos/task.h
@@ -233,7 +233,11 @@ typedef enum
  *
  * \ingroup SchedulerControl
  */
+#ifdef _ESP_FREERTOS_INTERNAL
 #define taskENTER_CRITICAL(mux)		portENTER_CRITICAL(mux)
+#else
+#define taskENTER_CRITICAL(mux) _Pragma("GCC warning \"'taskENTER_CRITICAL(mux)' is deprecated in ESP-IDF, consider using 'portENTER_CRITICAL(mux)'\"") portENTER_CRITICAL(mux)
+#endif
 #define taskENTER_CRITICAL_ISR(mux)		portENTER_CRITICAL_ISR(mux)
 
 /**
@@ -247,7 +251,11 @@ typedef enum
  *
  * \ingroup SchedulerControl
  */
+#ifdef _ESP_FREERTOS_INTERNAL
 #define taskEXIT_CRITICAL(mux)			portEXIT_CRITICAL(mux)
+#else
+#define taskEXIT_CRITICAL(mux) _Pragma("GCC warning \"'taskEXIT_CRITICAL(mux)' is deprecated in ESP-IDF, consider using 'portEXIT_CRITICAL(mux)'\"") portEXIT_CRITICAL(mux)
+#endif
 #define taskEXIT_CRITICAL_ISR(mux)		portEXIT_CRITICAL_ISR(mux)
 
 /**