taskENTER_CRITICAL();
LATBbits.LATB3 = ~LATBbits.LATB3; // Set LAT register bit 3 to turn on LED
taskEXIT_CRITICAL();
When I use the function vTaskDelayUntil the code does not work, but If I comment out my busy wait loops, those work well. I know the delayUntil function is a better way to go, as the processor might go to sleep in the idle task (hopefully a correct assumption)
I followed the debugger into the code, I can see the task get placed into the wait queue, but it’s really hard to see when the task is released from the wait queue.
You are correct, the tick interrupt is not running. I changed my code to this:
xLastWakeTime = xTaskGetTickCount();
vTaskDelayUntil(&xLastWakeTime, xFrequency);
I set a debug break on the vTaskDelayUntil line to read the value xLastWakeTime. The value read zero every time, i looped through the application.
Thinking I had the right option I turned on
#define configUSE_TICK_HOOK 1
That resulted into a compile error:
Source\tasks.c:1362: undefined reference to `vApplicationTickHook’
I am using a PIC24F16KA102 for my chip. So I know the scheduler is started as I call vTaskStartScheduler(); and that starts the task interrupt.
The suggestion was spot on, but I really don’t know how to make sure the tick interrupt is really working.
I really now know that the scheduler is giving control to my function but the interrupt tick is not working. I added an extra task to send a character on the UART. The uartTask and my ledTask (flasher) does not work together. At least I am not seeing a context switch between the two. So I have a configuration issue with my code, any more suggestions?