]> begriffs open source - freertos/blob - portable/template/port.c
Make taskYIELD available to unprivileged tasks (#817)
[freertos] / portable / template / port.c
1 /*
2  * FreeRTOS Kernel <DEVELOPMENT BRANCH>
3  * license and copyright intentionally withheld to promote copying into user code.
4  */
5
6 #include "FreeRTOS.h"
7 #include "task.h"
8
9 BaseType_t xPortStartScheduler( void )
10 {
11     return pdTRUE;
12 }
13
14 void vPortEndScheduler( void )
15 {
16 }
17
18 StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
19                                      TaskFunction_t pxCode,
20                                      void * pvParameters )
21 {
22     return NULL;
23 }
24
25 void vPortYield( void )
26 {
27     /* Save the current Context */
28     /* Switch to the highest priority task that is ready to run. */
29     vTaskSwitchContext();
30     /* Start executing the task we have just switched to. */
31 }
32
33 static void prvTickISR( void )
34 {
35     /* Interrupts must have been enabled for the ISR to fire, so we have to
36      * save the context with interrupts enabled. */
37
38     /* Maintain the tick count. */
39     if( xTaskIncrementTick() != pdFALSE )
40     {
41         /* Switch to the highest priority task that is ready to run. */
42         vTaskSwitchContext();
43     }
44
45     /* start executing the new task */
46 }