summaryrefslogtreecommitdiff
path: root/platformio/relayctl/src/relay.h
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2023-05-17 04:06:18 +0300
committerEvgeny Zinoviev <me@ch1p.io>2023-05-17 04:06:18 +0300
commitc0111bf4d3dd91f54d27346970e4c6e0a1ce357e (patch)
treebeb15167412bc3ed60e3e11e9076d27ea6f437e5 /platformio/relayctl/src/relay.h
parent893e21cc83ee1ecf236a005f1bf4893448e9b3ea (diff)
pio: products refactoring
Diffstat (limited to 'platformio/relayctl/src/relay.h')
-rw-r--r--platformio/relayctl/src/relay.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/platformio/relayctl/src/relay.h b/platformio/relayctl/src/relay.h
index ba7f5a6..5287f09 100644
--- a/platformio/relayctl/src/relay.h
+++ b/platformio/relayctl/src/relay.h
@@ -1,24 +1,26 @@
-#pragma once
+#ifndef HOMEKIT_RELAYCTL_RELAY_H
+#define HOMEKIT_RELAYCTL_RELAY_H
#include <Arduino.h>
-#include "config.def.h"
-namespace homekit { namespace relay {
+namespace homekit::relay {
inline void init() {
- pinMode(RELAY_PIN, OUTPUT);
+ pinMode(CONFIG_RELAY_GPIO, OUTPUT);
}
inline bool getState() {
- return digitalRead(RELAY_PIN) == HIGH;
+ return digitalRead(CONFIG_RELAY_GPIO) == HIGH;
}
inline void setOn() {
- digitalWrite(RELAY_PIN, HIGH);
+ digitalWrite(CONFIG_RELAY_GPIO, HIGH);
}
inline void setOff() {
- digitalWrite(RELAY_PIN, LOW);
+ digitalWrite(CONFIG_RELAY_GPIO, LOW);
}
-} } \ No newline at end of file
+}
+
+#endif //HOMEKIT_RELAYCTL_RELAY_H \ No newline at end of file