2 * FreeRTOS Kernel V11.1.0
3 * license and copyright intentionally withheld to promote copying into user code.
9 BaseType_t xPortStartScheduler( void )
14 void vPortEndScheduler( void )
18 StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
19 TaskFunction_t pxCode,
22 ( void ) pxTopOfStack;
23 ( void ) pvParameters;
29 void vPortYield( void )
31 /* Save the current Context */
33 /* Switch to the highest priority task that is ready to run. */
34 #if ( configNUMBER_OF_CORES == 1 )
40 vTaskSwitchContext( portGET_CORE_ID() );
44 /* Start executing the task we have just switched to. */
47 static void prvTickISR( void )
49 /* Interrupts must have been enabled for the ISR to fire, so we have to
50 * save the context with interrupts enabled. */
52 #if ( configNUMBER_OF_CORES == 1 )
54 /* Maintain the tick count. */
55 if( xTaskIncrementTick() != pdFALSE )
57 /* Switch to the highest priority task that is ready to run. */
63 UBaseType_t ulPreviousMask;
65 /* Tasks or ISRs running on other cores may still in critical section in
66 * multiple cores environment. Incrementing tick needs to performed in
67 * critical section. */
68 ulPreviousMask = taskENTER_CRITICAL_FROM_ISR();
70 /* Maintain the tick count. */
71 if( xTaskIncrementTick() != pdFALSE )
73 /* Switch to the highest priority task that is ready to run. */
74 vTaskSwitchContext( portGET_CORE_ID() );
77 taskEXIT_CRITICAL_FROM_ISR( ulPreviousMask );
79 #endif /* if ( configNUMBER_OF_CORES == 1 ) */
81 /* start executing the new task */