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

Getting Error on ESP8266 #21

Closed
bkrajendra opened this issue Nov 14, 2019 · 9 comments · May be fixed by #23
Closed

Getting Error on ESP8266 #21

bkrajendra opened this issue Nov 14, 2019 · 9 comments · May be fixed by #23

Comments

@bkrajendra
Copy link

Earlier was working fine,
But recently after some esp core arduino sdk update, its throwing error:

In file included from C:\Users\Rajendra\Documents\Arduino\libraries\TickerScheduler-master\TickerScheduler.h:47:0,

                 from C:\Users\Rajendra\Documents\Arduino\libraries\TickerScheduler-master\TickerScheduler.cpp:1:

C:\Users\Rajendra\Documents\Arduino\hardware\esp8266com\esp8266\libraries\Ticker/Ticker.h: In instantiation of 'void Ticker::attach_ms(uint32_t, void (*)(TArg), TArg) [with TArg = volatile bool*; uint32_t = unsigned int]':

C:\Users\Rajendra\Documents\Arduino\libraries\TickerScheduler-master\TickerScheduler.cpp:85:91:   required from here

C:\Users\Rajendra\Documents\Arduino\hardware\esp8266com\esp8266\libraries\Ticker/Ticker.h:74:112: error: reinterpret_cast from type 'volatile bool*' to type 'void*' casts away qualifiers

   _attach_ms(milliseconds, true, reinterpret_cast<callback_with_arg_t>(callback), reinterpret_cast<void *>(arg));
                                                                                                            ^
@bozont
Copy link

bozont commented Nov 19, 2019

Hello!
I can confirm it also, I'm getting the same compilation error.
Here's the breaking change in the underlying Ticker library: esp8266/Arduino@a833f27

@bkrajendra
Copy link
Author

temporarily i resolve it by changing those changes back to earlier what it was.
Thank you @bozont

_attach_ms(milliseconds, true, reinterpret_cast<callback_with_arg_t>(callback), reinterpret_cast<void*>(arg));

to

_attach_ms(milliseconds, true, reinterpret_cast<callback_with_arg_t>(callback), (void*)arg);

@bkrajendra
Copy link
Author

@Toshik please take a note of this:
esp8266/Arduino@a833f27#commitcomment-36981777

@bozont
Copy link

bozont commented Jan 27, 2020

Hello @bkrajendra !
Thanks for doing some further investigation! I solved the problem the same way as you were suggested in the esp8266/Arduino thread - by removing the volatile qualifier. For me it's been working steady since I made my previous comment. I can make a pull request from my changes, and if @Toshik agrees, it can be merged easily.

bozont added a commit to bozont/TickerScheduler that referenced this issue Jan 27, 2020
@dakky
Copy link

dakky commented May 3, 2020

@Toshik any plans to merge this PR?

@mmv-ru
Copy link

mmv-ru commented Jun 11, 2020

master...flavio-fernandes:esp8266.no.volatile
Look same but more complete

@mmv-ru
Copy link

mmv-ru commented Jun 11, 2020

Look like last compatible version of ESP8266 platform is 2.5.2

@45gfg9
Copy link

45gfg9 commented Jul 9, 2020

Ahh, compile error on macOS also

@Toshik
Copy link
Owner

Toshik commented Jul 9, 2020

Should be fixed by a2b4347

@Toshik Toshik closed this as completed Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants