Mixing Adruino code and FreeRTOS code in one project

YvesDS
Posts: 13
Joined: Sat Sep 30, 2017 10:57 am
Location: Bredene (Belgium)

Mixing Adruino code and FreeRTOS code in one project

Postby YvesDS » Tue Oct 10, 2017 12:33 pm

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

copercini
Posts: 26
Joined: Wed Dec 21, 2016 4:44 pm

Re: Mixing Adruino code and FreeRTOS code in one project

Postby copercini » Wed Oct 11, 2017 12:35 pm

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

Who is online

Users browsing this forum: No registered users and 110 guests