From ee95fde5ec2053365a4ed7274d569d08a41ac304 Mon Sep 17 00:00:00 2001
From: Angus Gratton <gus@projectgus.com>
Date: Thu, 7 May 2015 13:54:41 +1000
Subject: [PATCH] Change PendSV function signature to use enum

---
 FreeRTOS/Source/portable/esp8266/port.c      |  7 +------
 FreeRTOS/Source/portable/esp8266/portmacro.h | 15 +++++++--------
 2 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/FreeRTOS/Source/portable/esp8266/port.c b/FreeRTOS/Source/portable/esp8266/port.c
index 8bc1659..49e389d 100644
--- a/FreeRTOS/Source/portable/esp8266/port.c
+++ b/FreeRTOS/Source/portable/esp8266/port.c
@@ -107,11 +107,6 @@ pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *p
     return sp;
 }
 
-enum SVC_ReqType {
-  SVC_Software = 1,
-  SVC_MACLayer = 2,
-};
-
 static int pending_soft_sv;
 static int pending_maclayer_sv;
 
@@ -126,7 +121,7 @@ static int pending_maclayer_sv;
    In the original esp_iot_rtos_sdk implementation, arg was a char. Using an
    enum is ABI-compatible, though.
 */
-void PendSV( char req )
+void PendSV(enum SVC_ReqType req)
 {
 	vPortEnterCritical();
 
diff --git a/FreeRTOS/Source/portable/esp8266/portmacro.h b/FreeRTOS/Source/portable/esp8266/portmacro.h
index 7c11c15..dab5eb3 100644
--- a/FreeRTOS/Source/portable/esp8266/portmacro.h
+++ b/FreeRTOS/Source/portable/esp8266/portmacro.h
@@ -107,16 +107,15 @@ typedef unsigned int INT32U;
 
 #define ICACHE_FLASH_ATTR __attribute__((section(".irom0.text")))
 
+enum SVC_ReqType {
+  SVC_Software = 1,
+  SVC_MACLayer = 2,
+};
+
 /* Scheduler utilities. */
-extern void PendSV(char);
+extern void PendSV(enum SVC_ReqType);
 //#define portYIELD()	vPortYield()
-#define portYIELD()	PendSV(1)
-
-
-//#define portEND_SWITCHING_ISR( xSwitchRequired ) \
-//	if(xSwitchRequired) PendSV(1)
-
-#define HDL_MAC_SIG_IN_LV1_ISR() PendSV(2)
+#define portYIELD()	PendSV(SVC_Software)
 
 /* Task utilities. */
 #define portEND_SWITCHING_ISR( xSwitchRequired ) 	\