mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-16 04:22:22 +00:00
freertos: Add portTRY_ENTRY_CRITICAL() and deprecate legacy spinlock fucntions
Add TRY_ENTRY_CRITICAL() API to all for timeouts when entering critical sections. The following port API were added: - portTRY_ENTER_CRITICAL() - portTRY_ENTER_CRITICAL_ISR() - portTRY_ENTER_CRITICAL_SAFE() Deprecated legacy spinlock API in favor of spinlock.h. The following API were deprecated: - vPortCPUInitializeMutex() - vPortCPUAcquireMutex() - vPortCPUAcquireMutexTimeout() - vPortCPUReleaseMutex() Other Changes: - Added portMUX_INITIALIZE() to replace vPortCPUInitializeMutex() - The assembly of the critical section functions ends up being about 50 instructions longer, thus the spinlock test pass threshold had to be increased to account for the extra runtime. Closes https://github.com/espressif/esp-idf/issues/5301
This commit is contained in:
@@ -143,7 +143,7 @@ static BaseType_t prvTestWaitCondition( const EventBits_t uxCurrentEventBits,
|
||||
|
||||
traceEVENT_GROUP_CREATE( pxEventBits );
|
||||
#ifdef ESP_PLATFORM
|
||||
vPortCPUInitializeMutex( &pxEventBits->eventGroupMux );
|
||||
portMUX_INITIALIZE( &pxEventBits->eventGroupMux );
|
||||
#endif // ESP_PLATFORM
|
||||
}
|
||||
else
|
||||
@@ -196,7 +196,7 @@ static BaseType_t prvTestWaitCondition( const EventBits_t uxCurrentEventBits,
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
vPortCPUInitializeMutex( &pxEventBits->eventGroupMux );
|
||||
portMUX_INITIALIZE( &pxEventBits->eventGroupMux );
|
||||
#endif // ESP_PLATFORM
|
||||
|
||||
traceEVENT_GROUP_CREATE( pxEventBits );
|
||||
|
||||
Reference in New Issue
Block a user