diff options
Diffstat (limited to 'platformio/relayctl/src/relay.h')
-rw-r--r-- | platformio/relayctl/src/relay.h | 18 |
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 |