2021-08-01 12:58:39 -07:00
|
|
|
#include "functional_sensor.h"
|
|
|
|
#include "timer.h"
|
|
|
|
|
|
|
|
class FrequencySensor : public FunctionalSensor {
|
|
|
|
public:
|
|
|
|
FrequencySensor(SensorType type, efitick_t timeoutPeriod)
|
|
|
|
: FunctionalSensor(type, timeoutPeriod) { }
|
|
|
|
|
2021-09-20 12:39:41 -07:00
|
|
|
void init(brain_pin_e pin);
|
2021-08-20 23:02:05 -07:00
|
|
|
void deInit();
|
2021-08-01 12:58:39 -07:00
|
|
|
|
|
|
|
void onEdge(efitick_t nowNt);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Timer m_edgeTimer;
|
2021-08-20 23:02:05 -07:00
|
|
|
brain_pin_e m_pin = GPIO_UNASSIGNED;
|
2021-08-01 12:58:39 -07:00
|
|
|
};
|