kopia lustrzana https://github.com/espressif/esp-idf
Make vTaskEnterCritical callable from ISR
rodzic
be4dfed822
commit
08ec33c6a2
|
@ -163,6 +163,7 @@ typedef struct tskTaskControlBlock
|
||||||
|
|
||||||
#if ( portCRITICAL_NESTING_IN_TCB == 1 )
|
#if ( portCRITICAL_NESTING_IN_TCB == 1 )
|
||||||
UBaseType_t uxCriticalNesting; /*< Holds the critical section nesting depth for ports that do not maintain their own count in the port layer. */
|
UBaseType_t uxCriticalNesting; /*< Holds the critical section nesting depth for ports that do not maintain their own count in the port layer. */
|
||||||
|
uint32_t uxOldInterruptState; /*< Interrupt state before the outer taskEnterCritical was called */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||||
|
@ -2595,8 +2596,7 @@ BaseType_t xReturn;
|
||||||
|
|
||||||
/* THIS FUNCTION MUST BE CALLED FROM A CRITICAL SECTION. It can also be
|
/* THIS FUNCTION MUST BE CALLED FROM A CRITICAL SECTION. It can also be
|
||||||
called from a critical section within an ISR. */
|
called from a critical section within an ISR. */
|
||||||
//That makes the taskENTER_CRITICALs here unnecessary, right? -JD
|
taskENTER_CRITICAL_ISR(&xTaskQueueMutex);
|
||||||
// taskENTER_CRITICAL(&xTaskQueueMutex);
|
|
||||||
/* The event list is sorted in priority order, so the first in the list can
|
/* The event list is sorted in priority order, so the first in the list can
|
||||||
be removed as it is known to be the highest priority. Remove the TCB from
|
be removed as it is known to be the highest priority. Remove the TCB from
|
||||||
the delayed list, and add it to the ready list.
|
the delayed list, and add it to the ready list.
|
||||||
|
@ -2654,7 +2654,7 @@ BaseType_t xReturn;
|
||||||
prvResetNextTaskUnblockTime();
|
prvResetNextTaskUnblockTime();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// taskEXIT_CRITICAL(&xTaskQueueMutex);
|
taskEXIT_CRITICAL_ISR(&xTaskQueueMutex);
|
||||||
|
|
||||||
return xReturn;
|
return xReturn;
|
||||||
}
|
}
|
||||||
|
@ -3761,7 +3761,7 @@ scheduler will re-enable the interrupts instead. */
|
||||||
void vTaskEnterCritical( portMUX_TYPE *mux )
|
void vTaskEnterCritical( portMUX_TYPE *mux )
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
portDISABLE_INTERRUPTS();
|
portENTER_CRITICAL_NESTED(uxOldInterruptState);
|
||||||
#ifdef CONFIG_FREERTOS_PORTMUX_DEBUG
|
#ifdef CONFIG_FREERTOS_PORTMUX_DEBUG
|
||||||
vPortCPUAcquireMutex( mux, function, line );
|
vPortCPUAcquireMutex( mux, function, line );
|
||||||
#else
|
#else
|
||||||
|
@ -3814,7 +3814,7 @@ scheduler will re-enable the interrupts instead. */
|
||||||
|
|
||||||
if( pxCurrentTCB[ xPortGetCoreID() ]->uxCriticalNesting == 0U )
|
if( pxCurrentTCB[ xPortGetCoreID() ]->uxCriticalNesting == 0U )
|
||||||
{
|
{
|
||||||
portENABLE_INTERRUPTS();
|
portEXIT_CRITICAL_NESTED(uxOldInterruptState);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Ładowanie…
Reference in New Issue