FreeRTOS Tick Rate

Defaint is 100Hz / 10mS You can change it with make menuconfig: Component config > FreeRTOS > Tick Rate (Hz) Whacking it all the way up to 1000 will cause some things to be affected as the scheduler has less time to deal with calling different tasks.  

Read More

Priority

Priority Each task is assigned a priority from 0 to (configMAX_PRIORITIES – 1 ), (configMAX_PRIORITIES is defined  in FreeRTOSConfig.h). Low priority numbers denote low priority tasks. The idle task has priority zero (tskIDLE_PRIORITY). The task placed into the Running state by the scheduler is always the highest priority task that is able to run – higher priority tasks […]

Read More

Co-routines

Co-routines are rarely used these days and there are no plans to develop them further in FreeRTOS

Read More

.Tasks general

Resources https://www.freertos.org/taskandcr.html Tasks A RTOS application can be structured as a set of independent tasks Each task executes within its own context with no coincidental dependency on other tasks within the system or the RTOS scheduler. Only one task within the application can be executing at any point in time and the real time RTOS […]

Read More

Semaphores

Semaphores are typically used for both synchronization and mutual exclusion in access to resources. Semaphore example #include "semphr.h" //Create semphore SemaphoreHandle_t SemaphoreHandle1 = NULL; SemaphoreHandle1 = xSemaphoreCreateMutex(); //Use sempahore xSemaphoreTake(SemaphoreHandle1, portMAX_DELAY); //Do something… xSemaphoreGive(SemaphoreHandle1);  

Read More

printf

#include <stdio.h> Remember to include a terminating "\n" in your printf – stdout doesn't flush until it encounters one by default!!!! printf("Hello world!\n"); printf("%i bytes read : %s\n", rx_length, rx_buffer); printf("data_h: %02x\n", sensor_data_h); printf format codes d or i – int, decimal (base ten) number x or X – int, hexadecimal number.  Also "%02x" to specify length of […]

Read More

Background Timers

Get time in uS since powerup int64_t esp_timer_get_time() esp_timer_get_time() returns 64-bit time since startup, in microseconds. int64 = 292,471 years before overflow at uS resolution! Unlike gettimeofday function, values returned by esp_timer_get_time() start from zero after startup of the chip wakes up from deep sleep and do not have timezone or DST adjustments applied.    

Read More