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;
106
106
107
107
/* Task utilities. */
108
108
#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
110
121
#define portNOP () __asm volatile ( "NOP" )
111
122
/*-----------------------------------------------------------*/
112
123
Original file line number Diff line number Diff line change 130
130
/* Task utilities. */
131
131
#define portNOP () __asm( "NOP" )
132
132
#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
134
145
/*-----------------------------------------------------------*/
135
146
136
147
/* Hardware specifics. */
You can’t perform that action at this time.
0 commit comments