47 lines
884 B
C++
47 lines
884 B
C++
#ifndef OVERCURRENTPROT_H_
|
|
#define OVERCURRENTPROT_H_
|
|
|
|
|
|
#include "cmd.h"
|
|
|
|
|
|
#define CURRENT_SHUTDOWN 5
|
|
#define CURRENT_ON 0
|
|
#define CURRENT_OFF 1
|
|
#define CURRENT_INTERRUPT 3
|
|
|
|
const unsigned long TURN_ON_DELAY = 2000; // ms
|
|
|
|
|
|
class OverCurrentProt;
|
|
|
|
class OverCurrentProtCmd : public Cmd {
|
|
public:
|
|
OverCurrentProtCmd(OverCurrentProt *overCurrentProt);
|
|
virtual String getCmdName() { return "LC"; }
|
|
virtual String getHelp() { return "Loop control"; }
|
|
virtual String exec(String params);
|
|
private:
|
|
OverCurrentProt *m_overCurrentProt;
|
|
};
|
|
|
|
|
|
|
|
|
|
class OverCurrentProt {
|
|
public:
|
|
OverCurrentProt();
|
|
void begin(CmdServer *cmdServer);
|
|
void exec();
|
|
uint32_t getEventCnt() { return m_eventCnt; };
|
|
void resetEventCnt() { m_eventCnt = 0; };
|
|
private:
|
|
OverCurrentProtCmd m_overCurrentProtCmd;
|
|
uint32_t m_eventCnt;
|
|
unsigned long m_timestamp;
|
|
};
|
|
|
|
|
|
|
|
#endif /* OVERCURRENTPROT_H_ */
|