Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of SoftSerial by
SoftSerial_Ticker.h
00001 //A modified version of the regular ticker/timeout libraries to allow us to do timeout without losing accuracy 00002 00003 #ifndef FLEXTICKER_H 00004 #define FLEXTICKER_H 00005 00006 #include "mbed.h" 00007 00008 class FlexTicker: public TimerEvent { 00009 public: 00010 template<typename T> 00011 void attach(T* tptr, void (T::*mptr)(void)) { 00012 _function.attach(tptr, mptr); 00013 } 00014 00015 /** Detach the function 00016 */ 00017 void detach() { 00018 remove(); 00019 } 00020 00021 void setNext(int delay) { 00022 insert(event.timestamp + delay); 00023 } 00024 00025 void prime(void) { 00026 event.timestamp = us_ticker_read(); 00027 } 00028 00029 protected: 00030 virtual void handler() { 00031 _function.call(); 00032 } 00033 00034 unsigned int _delay; 00035 FunctionPointer _function; 00036 }; 00037 00038 #endif
Generated on Tue Jul 12 2022 19:58:55 by
1.7.2
