Chat freely about anything...

User avatar
By HamzaHajeir
#79914 Hello guys.

I am learning about timing and alternatives of delay(). millis() and so.

So checked the Ticker library and wondering if it's based on millis or not.

I tried to re-engineer it, but ends up with _ETSTIMER_ type functions :

Code: Select all   os_timer_setfn(_timer, reinterpret_cast<ETSTimerFunc*>(callback), reinterpret_cast<void*>(arg));
   os_timer_arm(_timer, milliseconds, (repeat)?REPEAT:ONCE);


Found this SDK documentation, but it doesn't dive more.

Also found its header file. But i can't find the body of them.


Can anyone explain the ETSTIMER and where it its functions goes ?
Last edited by HamzaHajeir on Wed Jan 09, 2019 3:48 am, edited 1 time in total.
User avatar
By McChubby007
#79915 Surely if you investigated ticker then you simply looked at the code to see if it used millis() or not?!! I don't see why you need someone else to answer that for you.

Using millis() although simple is not efficient.

Why are you trying to 're-engineer' it? It works without mucking it about!

The functions you refer to, set the function to receive the periodic timer interrupt,and set the time period respectively. I'm sure that it is all documented as I have used it in the past. As a minimum the relevant .h file explains in enough detail.

I can't understand what your problem is.
User avatar
By HamzaHajeir
#79926
McChubby007 wrote:Surely if you investigated ticker then you simply looked at the code to see if it used millis() or not?!! I don't see why you need someone else to answer that for you.

Using millis() although simple is not efficient.

Why are you trying to 're-engineer' it? It works without mucking it about!

The functions you refer to, set the function to receive the periodic timer interrupt,and set the time period respectively. I'm sure that it is all documented as I have used it in the past. As a minimum the relevant .h file explains in enough detail.

I can't understand what your problem is.


It's for learning purpose, The curiosity of knowing if it's millis() dependent as such libraries, If not, What its source code.

Neither there's a problem or not. There's no problem at all!


McChubby007 wrote:You know, I get irrritated by laziness and stupidity. I just googled for ostimer and the 6th result gives all the examples you need without even having to think:

https://www.switchdoc.com/2015/10/iot-e ... duino-ide/


You would know if i've searched for it as i can or not, If you read the post well.

I focused to search ETSTIMER and where its function's source code, And you got the key from the code above!

Finally Thank you At all ;)
I will read that very soon.