60 lines
797 B
C
60 lines
797 B
C
#ifndef IO_H
|
|
#define IO_H
|
|
|
|
#include "Relay.h"
|
|
#include "Button.h"
|
|
|
|
void buttonCallback(Output &output, ButtonEvent event);
|
|
|
|
extern Output status;
|
|
|
|
extern Button button0;
|
|
|
|
extern Relay relay0;
|
|
|
|
#ifdef Sonoff4ChPro
|
|
|
|
extern Button button1;
|
|
|
|
extern Button button2;
|
|
|
|
extern Button button3;
|
|
|
|
extern Relay relay1;
|
|
|
|
extern Relay relay2;
|
|
|
|
extern Relay relay3;
|
|
|
|
#endif
|
|
|
|
inline void ioSetup() {
|
|
status.setup();
|
|
button0.setup();
|
|
relay0.setup();
|
|
#ifdef Sonoff4ChPro
|
|
button1.setup();
|
|
button2.setup();
|
|
button3.setup();
|
|
relay1.setup();
|
|
relay2.setup();
|
|
relay3.setup();
|
|
#endif
|
|
}
|
|
|
|
inline void ioLoop() {
|
|
status.loop();
|
|
button0.loop();
|
|
relay0.loop();
|
|
#ifdef Sonoff4ChPro
|
|
button1.loop();
|
|
button2.loop();
|
|
button3.loop();
|
|
relay1.loop();
|
|
relay2.loop();
|
|
relay3.loop();
|
|
#endif
|
|
}
|
|
|
|
#endif
|