File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,18 @@ typedef unsigned short UBaseType_t;
106106
107107/* Task utilities. */
108108#define portYIELD () __asm volatile ( "BRK" )
109- #define portYIELD_FROM_ISR ( xHigherPriorityTaskWoken ) do { if( xHigherPriorityTaskWoken ) vTaskSwitchContext( ); } while( 0 )
109+ #ifndef configREQUIRE_ASM_ISR_WRAPPER
110+ #define configREQUIRE_ASM_ISR_WRAPPER 1
111+ #endif
112+ #if ( configREQUIRE_ASM_ISR_WRAPPER == 1 )
113+ /* You must implement an assembly ISR wrapper (see the below for details) if you need an ISR to cause a context switch.
114+ * https://www.freertos.org/Documentation/02-Kernel/03-Supported-devices/04-Demos/Renesas/RTOS_RL78_IAR_Demos#writing-interrupt-service-routines */
115+ #define portYIELD_FROM_ISR ( xHigherPriorityTaskWoken ) do { if( xHigherPriorityTaskWoken != pdFALSE ) vTaskSwitchContext(); } while( 0 )
116+ #else
117+ /* You must not implement an assembly ISR wrapper even if you need an ISR to cause a context switch.
118+ * The portYIELD, which is similar to role of an assembly ISR wrapper, runs only when a context switch is required. */
119+ #define portYIELD_FROM_ISR ( xHigherPriorityTaskWoken ) do { if( xHigherPriorityTaskWoken != pdFALSE ) portYIELD(); } while( 0 )
120+ #endif
110121#define portNOP () __asm volatile ( "NOP" )
111122/*-----------------------------------------------------------*/
112123
Original file line number Diff line number Diff line change 130130/* Task utilities. */
131131 #define portNOP () __asm( "NOP" )
132132 #define portYIELD () __asm( "BRK" )
133- #define portYIELD_FROM_ISR ( xHigherPriorityTaskWoken ) do { if( xHigherPriorityTaskWoken ) vTaskSwitchContext( ); } while( 0 )
133+ #ifndef configREQUIRE_ASM_ISR_WRAPPER
134+ #define configREQUIRE_ASM_ISR_WRAPPER 1
135+ #endif
136+ #if ( configREQUIRE_ASM_ISR_WRAPPER == 1 )
137+ /* You must implement an assembly ISR wrapper (see the below for details) if you need an ISR to cause a context switch.
138+ * https://www.freertos.org/Documentation/02-Kernel/03-Supported-devices/04-Demos/Renesas/RTOS_RL78_IAR_Demos#writing-interrupt-service-routines */
139+ #define portYIELD_FROM_ISR ( xHigherPriorityTaskWoken ) do { if( xHigherPriorityTaskWoken != pdFALSE ) vTaskSwitchContext(); } while( 0 )
140+ #else
141+ /* You must not implement an assembly ISR wrapper even if you need an ISR to cause a context switch.
142+ * The portYIELD, which is similar to role of an assembly ISR wrapper, runs only when a context switch is required. */
143+ #define portYIELD_FROM_ISR ( xHigherPriorityTaskWoken ) do { if( xHigherPriorityTaskWoken != pdFALSE ) portYIELD(); } while( 0 )
144+ #endif
134145/*-----------------------------------------------------------*/
135146
136147/* Hardware specifics. */
You can’t perform that action at this time.
0 commit comments