A class to call a function at the main function at regular intervals (using Ticker class)

Dependents:   GPS_0002 optWingforHAPS_Eigen hexaTest_Eigen

LoopTicker.hpp

Committer:
cocorlow
Date:
2021-01-21
Revision:
0:d9fd30e1ebe4

File content as of revision 0:d9fd30e1ebe4:

#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