freertos(SMP): Fix SMP FreeRTOS RISC-V statement expression macro

Macros that need to reteurn a value should use GCC statement expression macro
syntax. This commit fixes the portTRY_ENTER_CRITICAL() in the RISC-V port of
SMP FreeRTOS to be a statement expression macro.
This commit is contained in:
Darian Leung 2022-11-16 17:51:10 +08:00
parent cce1f9dee4
commit 623f20d2b5

View File

@ -256,11 +256,11 @@ void vPortEnterCritical(void);
void vPortExitCritical(void);
//IDF task critical sections
#define portTRY_ENTER_CRITICAL(lock, timeout) {((void) lock; (void) timeout; vPortEnterCritical(); pdPASS;)}
#define portTRY_ENTER_CRITICAL(lock, timeout) ({(void) lock; (void) timeout; vPortEnterCritical(); pdPASS;})
#define portENTER_CRITICAL_IDF(lock) ({(void) lock; vPortEnterCritical();})
#define portEXIT_CRITICAL_IDF(lock) ({(void) lock; vPortExitCritical();})
//IDF ISR critical sections
#define portTRY_ENTER_CRITICAL_ISR(lock, timeout) {((void) lock; (void) timeout; vPortEnterCritical(); pdPASS;)}
#define portTRY_ENTER_CRITICAL_ISR(lock, timeout) ({(void) lock; (void) timeout; vPortEnterCritical(); pdPASS;})
#define portENTER_CRITICAL_ISR(lock) ({(void) lock; vPortEnterCritical();})
#define portEXIT_CRITICAL_ISR(lock) ({(void) lock; vPortExitCritical();})
//IDF safe critical sections (they're the same)