-
Notifications
You must be signed in to change notification settings - Fork 256
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
Xtensa compiler (esp8266): Declaration of constructor does not match implementation #11
Comments
I have not yet tried to use TaskScheduler with esp8266. Very cool. Will fix the type mismatch as soon as I get back to my laptop. |
Could you please test v2.0.1? |
Fyi,I did a quick-n-dirty private port a few months back on v1.8.2 and it did work very well. I noted: -the task constructor declaration bug which you've now fixed. A diff of my code showed I made a declaration at top: #ifndef _ESP8266 #include <avr/sleep.h> #include <avr/power.h> #endif and a conditional test for ESP8266 in Scheduler::execute() #ifdef _TASK_SLEEP_ON_IDLE_RUN if (idleRun && iAllowSleep) { #ifdef _ESP8266 const int sleepTimeMs = 1; ESP.deepSleep(sleepTimeMs*1000); #else set_sleep_mode(SLEEP_MODE_IDLE); sleep_enable(); /* Now enter sleep mode. */ sleep_mode(); /* The program will continue from here after the timer timeout ~1 ms */ sleep_disable(); /* First thing to do is disable sleep. */ #endif |
Great. Thanks for sharing. I will incorporate your updates in the next version. Enjoy! Glad you find TaskScheduler suitable for your projects. |
Thanks a lot to you for this great project! This code is exactly what I was looking for. I will try again once the other changes are in place. Cool stuff! 👍 |
Thank you. Always good to know your work is useful for someone. :) |
@alw1746 |
@alw1746
According to many articles (this for example: http://tinker.yeoman.com.au/2015/03/08/reducing-esp8266-power-consumption-using-deep-sleep/) esp8266 does a full reset after wake up, which would restart the sketch - not the behavior execute() function needs. Instead suggest this: Add wifi sleep mode setter in the allowSleep() method:
and this to the execute() method:
|
hmm..in that case I don't understand. I ran example 6 and this is what I got, |
@alw1746 for the following tasks:
c1 should be "around" 10000 (with the IDLE RUN SLEEP enabled), so clearly it does not sleep. Without IDLE RUN SLEEP for UNO at 16 MHz c1=529783 (v1.9.0: 551947) I suppose ESP8266 is running at 80 MHz, but is probably doing a lot more in the background for WFL, so straight extrapolation (~550000 / 16 * 80 = 2750000) will not be accurate. 828914 "feels" low, but then again, I am not sure what else CPU is scheduled to do (probably a lot). I guess it is time for me to pull my esp8266 out and start testing :) PLEASE CHECK THE TESTING BRANCH WITH RECENT UPDATES FOR ESP8266!! |
@alw1746 |
sorry mate been away so haven't had a chance to make blinky lights. But I'm downloading the latest ESP8266 Arduino build now so will let you know in the next day or so... |
@alw1746 no problem! Thanks for doing this actually. Please use the testing branch for this. |
Had some problems with my ESP8266 Arduino v2.0.0 download so I tested Taskscheduler 2.02 (testing branch) against ESP8266 v1.65 on my board already. Attached test results. All worked apart from Example 7 (WDT) which I'll test again once I get 2.0.0 sorted out. Some minor mods needed, see the test results. |
Running with ESP8266 Arduino 2.0.0 now but can't get Example 7 to work. Replaced the timeout setting code with, //reset watchdog But below ISR failed to compile as WDT_vect is not exposed in Esp.h. ISR(WDT_vect) |
@alw1746 Let me look into WDT a little closer. And I still didn't put the chip to sleep per se, just delayed by 1 ms in case IDLE SLEEP is activated, so a bit of "cheating" on my end... To be investigated further.... |
@alw1746 |
Just pushed the update with examples changes into 'testing' branch. |
Compiling TaskScheduler.h using the
xtensa-lx106-elf-g++
compiler (esp8266) fails. Apparently, it can not match the declaration of the constructor with its implementation because of mixingboolean
andbool
for parameteraEnable
.needs to become
The text was updated successfully, but these errors were encountered: