A class to call a function at the main function at regular intervals (using Ticker class)
Dependents: GPS_0002 optWingforHAPS_Eigen hexaTest_Eigen
Diff: LoopTicker.hpp
- Revision:
- 0:d9fd30e1ebe4
diff -r 000000000000 -r d9fd30e1ebe4 LoopTicker.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LoopTicker.hpp Thu Jan 21 15:45:43 2021 +0000 @@ -0,0 +1,21 @@ +#ifndef _LOOPTICKER_HPP_ +#define _LOOPTICKER_HPP_ + +#include "mbed.h" + +class LoopTicker +{ +public: + LoopTicker(); + void attach(void (*fptr_)(), float time_); + void detach(); + void loop(); +private: + Ticker ticker_; + void (*fptr)(); + float time; + bool updated; + void interrupt(); +}; + +#endif \ No newline at end of file