Fix prev code to not crash horribly when scheduler is not running yet
This commit is contained in:
parent
08ec33c6a2
commit
128bb77c5a
|
@ -3761,7 +3761,10 @@ scheduler will re-enable the interrupts instead. */
|
||||||
void vTaskEnterCritical( portMUX_TYPE *mux )
|
void vTaskEnterCritical( portMUX_TYPE *mux )
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
portENTER_CRITICAL_NESTED(uxOldInterruptState);
|
if( xSchedulerRunning != pdFALSE )
|
||||||
|
{
|
||||||
|
portENTER_CRITICAL_NESTED(pxCurrentTCB[ xPortGetCoreID() ]->uxOldInterruptState);
|
||||||
|
}
|
||||||
#ifdef CONFIG_FREERTOS_PORTMUX_DEBUG
|
#ifdef CONFIG_FREERTOS_PORTMUX_DEBUG
|
||||||
vPortCPUAcquireMutex( mux, function, line );
|
vPortCPUAcquireMutex( mux, function, line );
|
||||||
#else
|
#else
|
||||||
|
@ -3814,7 +3817,7 @@ scheduler will re-enable the interrupts instead. */
|
||||||
|
|
||||||
if( pxCurrentTCB[ xPortGetCoreID() ]->uxCriticalNesting == 0U )
|
if( pxCurrentTCB[ xPortGetCoreID() ]->uxCriticalNesting == 0U )
|
||||||
{
|
{
|
||||||
portEXIT_CRITICAL_NESTED(uxOldInterruptState);
|
portEXIT_CRITICAL_NESTED(pxCurrentTCB[ xPortGetCoreID() ]->uxOldInterruptState);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue