summaryrefslogtreecommitdiff
path: root/platformio/temphum/src/temphum.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platformio/temphum/src/temphum.cpp')
-rw-r--r--platformio/temphum/src/temphum.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/platformio/temphum/src/temphum.cpp b/platformio/temphum/src/temphum.cpp
index 0b6fbbe..9fcc2cc 100644
--- a/platformio/temphum/src/temphum.cpp
+++ b/platformio/temphum/src/temphum.cpp
@@ -1,16 +1,22 @@
-#include "temphum.h"
-#include "logging.h"
+#ifndef CONFIG_TARGET_ESP01
#include <Arduino.h>
+#endif
+
+#include "temphum.h"
namespace homekit::temphum {
static const int addr = 0x40;
void setup() {
- pinMode(D2, OUTPUT);
- pinMode(D3, OUTPUT);
-
- Wire.begin(D2, D3);
+#ifndef CONFIG_TARGET_ESP01
+ pinMode(CONFIG_SDA_GPIO, OUTPUT);
+ pinMode(CONFIG_SCL_GPIO, OUTPUT);
+
+ Wire.begin(CONFIG_SDA_GPIO, CONFIG_SCL_GPIO);
+#else
+ Wire.begin();
+#endif
Wire.beginTransmission(addr);
Wire.write(0xfe);