Skip to content

Ticker active() method is not defined #1864

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

Closed
warwound opened this issue Sep 15, 2018 · 12 comments
Closed

Ticker active() method is not defined #1864

warwound opened this issue Sep 15, 2018 · 12 comments
Labels
Status: Stale Issue is stale stage (outdated/stuck)

Comments

@warwound
Copy link

This is a simple issue/question.

Why has the Ticker library's active() method not been defined?
I'm using the Ticker library in an ESP8266 project and tried to compile it for ESP32.
Compilation fails with an error:

undefined reference to `Ticker::active()'

Looking at the Ticker.h header file i see the active() method but in the Ticker.cpp i see it is not defined:
https://github.com/esp8266/Arduino/tree/master/libraries/Ticker

Is there a reason for this or is it just an oversight?

@warwound
Copy link
Author

I have just copy/pasted the ESP8266 definition of Ticker::active() into my ESP32 Ticker.cpp and it works perfectly:

bool Ticker::active(){ return (bool)_timer; }

@bertmelis
Copy link
Contributor

Oups! 😳 I just found out I forgot to implement that one.

I was wondering: what is the functionality of active()? The solution above works fine for periodic Tickers. But how about the single-shot Tickers?

I would say active() means "still running but noy yet fired".

It is relatively simple to implement the functionality, but there are also the PRs for "functional Ticker" and "FreeRTOS style Ticker" so I don't know what is the direction we're heading at.

@me-no-dev Maybe you can enlighten us?

@me-no-dev
Copy link
Member

we should go the RTOS way. This is what makes sense on ESP32 :)

@hreintke
Copy link
Contributor

@me-no-dev :
Can you take a look on #1766.
If that is OK for you I can make a PR to replace current Ticker with this.

@bertmelis
Copy link
Contributor

👍 Current ticker uses the legacy timer. And there is no need to maintain multiple implementations imho.

@laercionit
Copy link

I'm porting a code that had the following statement in ESP8266:

Tickert ArrayTicker [10];

Unfortunately the esp32 core is not accepting the ArrayTicker [x] .active () method;
Should this work?

@beegee-tokyo
Copy link
Contributor

Try
Ticker ArrayTicker [10];
instead of
Tickert ArrayTicker [10];

Hope you see the difference.

@laercionit
Copy link

Obviously it was a typo, as mentioned by our friend @warwound, it was missing from the CPP in the method. When copying from ESP8266 worked. Thanks for noticing a typo.

@stale
Copy link

stale bot commented Jul 31, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale Issue is stale stage (outdated/stuck) label Jul 31, 2019
@stale
Copy link

stale bot commented Aug 14, 2019

This stale issue has been automatically closed. Thank you for your contributions.

@stale stale bot closed this as completed Aug 14, 2019
@maxgerhardt
Copy link
Contributor

This is still not resolved and people in the PlatformIO forum are asking us why their build fails (here).

@gamebeast2k
Copy link

yep 9 mon later still not fixed. #5919 resolved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Issue is stale stage (outdated/stuck)
Projects
None yet
Development

No branches or pull requests

8 participants