Page 1 of 1

Mixing Adruino code and FreeRTOS code in one project

Posted: Tue Oct 10, 2017 12:33 pm
by YvesDS
Hi all,
Can esp32 Arduino code be mixed with FreeRTOS code in 1 file (1project)?

Say one wants to use an arduino liquidcrystal_i2c, or neopixel library, but also use the two esp cores for working with interrupts and passing data from core2 (ESP32-IDF) to core1 (Arduino)

Grtz,
Yves

Re: Mixing Adruino code and FreeRTOS code in one project

Posted: Wed Oct 11, 2017 12:35 pm
by copercini
Arduino for ESP32 is nothing more than a layer on FreeRTOS, so there are some ways to do this:

1- Calling freeRTOS functions in a Arduino code (this is the less optimized way)
2- Using arduino as IDF component, this will allow you to run arduino code on IDF, also use FreeRTOS functions too
3- Use arduino libs as C functions: some libraries are written in pure C and not depend of arduino core to run, so in some cases you can use them directly, or with few modifications, just be careful about thread safe stuff