Search code examples
esp32freertos

What header contains TickType_t?


error: 'TickType_t' has not been declared

Which header has this?

FreeRTOS, C++11, ESP32


Solution

  • You need to include the freeRTOS source tree, add additionally specify the following paths to your compiler:

    FreeRTOS
    FreeRTOS/include
    FreeRTOS/portable/<your-compiler>/<your-processor-arch>
    

    this happens because freeRTOS header files use relative includes of the form "FreeRTOS.h", if FreeRTOS.h is under /Src/include/FreeRTOS.h the compiler needs to have in its path /Src/include/ , otherwise it will fail to find it.

    As far as your question goes, it is defined in portmacro.h, but this file is found under freeRtos/portable/<your-compiler>/<your-processor-arch>/portmacro.h For example if you are compiling with gcc and using an ARM-Cortex4F, it will be under freeRTOS/portable/GCC/ARM_CM4F/portmacro.h