Skip to content

Ticker active() method is not defined #1864

Closed
@warwound

Description

@warwound

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?

Activity

warwound

warwound commented on Sep 15, 2018

@warwound
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

bertmelis commented on Jan 10, 2019

@bertmelis
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

me-no-dev commented on Jan 10, 2019

@me-no-dev
Member

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

hreintke

hreintke commented on Jan 12, 2019

@hreintke
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

bertmelis commented on Jan 12, 2019

@bertmelis
Contributor

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

laercionit

laercionit commented on May 20, 2019

@laercionit

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

beegee-tokyo commented on May 20, 2019

@beegee-tokyo
Contributor

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

Hope you see the difference.

laercionit

laercionit commented on May 20, 2019

@laercionit

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

stale commented on Jul 31, 2019

@stale

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 commented on Aug 14, 2019

@stale

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

maxgerhardt

maxgerhardt commented on Apr 26, 2021

@maxgerhardt
Contributor

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

gamebeast2k

gamebeast2k commented on Jan 5, 2022

@gamebeast2k

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleIssue is stale stage (outdated/stuck)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Ticker active() method is not defined · Issue #1864 · espressif/arduino-esp32