Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question regarding custom components and threads on ESP32 #277

Closed
yawor opened this issue Nov 18, 2018 · 3 comments

Comments

@yawor
Copy link

@yawor yawor commented Nov 18, 2018

Hi,

I'm new to esphomelib, Platformio and Arduino framework. Up until now I've been working directly with ESP-IDF.
I'd like to implement a custom component which would need to use threads. Is this possible in in esphomelib? I've found some examples of using pthreads with Arduino framework, but it was implemented on top of ESP-IDF and FreeRTOS. If I'm not mistaken, esphomelib doesn't use ESP-IDF at all.

@OttoWinter

This comment has been minimized.

Copy link
Member

@OttoWinter OttoWinter commented Nov 18, 2018

The ESP32 arduino framework uses the esp-idf framework. So you do have access to all esp-idf stuff (esphomelib internally also uses a lot of esp-idf components rmt, ble, pulse_counter, ...)

@yawor

This comment has been minimized.

Copy link
Author

@yawor yawor commented Nov 18, 2018

Ah that't great. I've been looking for downloaded esp-idf but I couldn't find it so I've wrongly assumed that it uses some other implementation.
After your comment I've tried adding #include "freertos/FreeRTOS.h" into main.cpp (I should have done this in the first place) and it didn't complain during compilation.
BTW if I'm going to use SPI, should I use SPI abstraction from Arduino framework? Or can I use it directly from ESP-IDF? I don't intend to use another SPI device on that node.

@OttoWinter

This comment has been minimized.

Copy link
Member

@OttoWinter OttoWinter commented Nov 18, 2018

I haven't tried either abstraction yet, but I think the esp-idf one works - except of course if you use the SPI controller that's responsible for the flash memory.

@OttoWinter OttoWinter closed this Nov 27, 2018
@esphome esphome locked and limited conversation to collaborators Jun 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.