Search code examples
arduinoesp32rtos

Using RTOS in library for ESP32


I am not new to programming for Arduino and the likes. But with ESP32 having 2 cores I wanted to make use of RTOS. I did this easily in the main source file (I use platformio to program). I would like to make libraries using this, but my programming background is VB, C#, and java..so I think I lack some understanding of how c and c++ sees libraries. I just want to start with a library that can do a blink sketch to try to understand how to do this in a library. I get reference errors when I try and would appreciate if someone can provide a library with this simple task so I can understand it better.


Solution

  • You're in luck, as Arduino on ESP32 is running on ESP-IDF which, in turn, is already running on FreeRTOS: https://docs.espressif.com/projects/esp-idf/en/v5.0.1/esp32/api-reference/system/freertos.html

    To learn more about FreeRTOS I recommend that you start with their excellent book/tutorial Mastering the FreeRTOS Real Time Kernel - a Hands On Tutorial Guide