19 lines
360 B
C++
19 lines
360 B
C++
#pragma once
|
|
#include <uart/Gpio.h>
|
|
#include <thread>
|
|
#include <functional>
|
|
|
|
class PinMonitor
|
|
{
|
|
public:
|
|
PinMonitor(unsigned int pinNum, std::function<void(int)> call_back);
|
|
~PinMonitor();
|
|
|
|
private:
|
|
void monitor();
|
|
//sched_param thparm;
|
|
Gpio pin;
|
|
std::function<void(unsigned int)> call_back;
|
|
std::thread thread_monitor;
|
|
volatile bool bMonitor = true;
|
|
}; |