Enter a SMP critical section with a timeout This function enters an SMP critical section by disabling interrupts then taking a spinlock with a specified timeout. This function can be called in a nested manner.
Timeout to wait for spinlock in number of CPU cycles. Use portMUX_NO_TIMEOUT to wait indefinitely Use portMUX_TRY_LOCK to only getting the spinlock a single time
Return value
pdPASS Critical section entered (spinlock taken) pdFAIL If timed out waiting for spinlock (will not occur if using portMUX_NO_TIMEOUT)
Notes
This function is made non-inline on purpose to reduce code size
Related Functions
Found 10 other functions taking a spinlock_t
argument:
Exit a SMP critical section This function can be called in a nested manner. On the outer most level of nesting, this function will: - Release the spinlock - Restore the previous interrupt level before the critical section was entered If still nesting, this function simply decrements a critical nesting count
Enter a SMP critical section This function enters an SMP critical section by disabling interrupts then taking a spinlock with an unlimited timeout. This function can be called in a nested manner
Safe version of enter critical timeout Safe version of enter critical will automatically select between portTRY_ENTER_CRITICAL() and portTRY_ENTER_CRITICAL_ISR()
FreeRTOS Compliant version of xPortEnterCriticalTimeout() Compliant version of xPortEnterCriticalTimeout() will ensure that this is called from a task context only. An abort is called otherwise.
FreeRTOS compliant version of vPortEnterCritical() Compliant version of vPortEnterCritical() will ensure that this is called from a task context only. An abort is called otherwise.
FreeRTOS compliant version of vPortExitCritical() Compliant version of vPortExitCritical() will ensure that this is called from a task context only. An abort is called otherwise.
Examples
xPortEnterCriticalTimeout() is referenced by 1 libraries and example projects: