arkhipenko / TaskScheduler

Cooperative multitasking for Arduino, ESPx, STM32, nRF and other microcontrollers
http://playground.arduino.cc/Code/TaskScheduler
BSD 3-Clause "New" or "Revised" License
1.23k stars 224 forks source link

updated Esp32, merged for testing branch #48

Closed baggior closed 6 years ago

baggior commented 6 years ago

since the last PR was closed #47 and was intended to merge ESP32 support on master branch I've issued this new pull resquest to be merged on the testing branch

arkhipenko commented 6 years ago

Merged manually again. Hopefully no errors this time. Please test. Branch: "Testing"

baggior commented 6 years ago

The library seems to work well with ESP32

but for _TASK_SLEEP_ON_IDLE_RUN, the light sleep mode of the ESP32 is not working as expected (by now), disables connectivity and freezes the MCU, so I've actually implemented with a safe delay(1) until further framework updates

you can merge now (in testing or even in master)

arkhipenko commented 6 years ago

Yeah, I ran into similar issues with 8266 - their understanding of a "light" sleep is different from AVR. We can just use the same process as 8266 for now, no?

baggior commented 6 years ago

yes is what I did but the process is not the same as for the 8266, in that delay there are some specific features enabled via "user_interface.h" header and they don't exists for ESP32 (not analogue found)

so the solution is a standard delay or don't use the _TASK_SLEEP_ON_IDLE_RUN feature at all (maybe it is the best option)

you can merge and close

arkhipenko commented 6 years ago

Thank you for your help! If not a secret, what are you using TS for?

baggior commented 6 years ago

it is simply and old project based on esp8266 I'm tryng to port to ESP32 The MCU is remotely controlling my heatpump and my home room temperatures in a "clever" way

arkhipenko commented 6 years ago

Cool

arkhipenko commented 6 years ago

OK. Done with the merge. Should be OK now.

baggior commented 6 years ago

when will you merge testing to master branch?

arkhipenko commented 6 years ago

Done