summaryrefslogtreecommitdiff
path: root/platformio/temphum/src/util.h
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2023-05-11 04:18:08 +0300
committerEvgeny Zinoviev <me@ch1p.io>2023-05-11 04:18:12 +0300
commit0aba139aeff8ff80757c5d36502413299a0b449e (patch)
tree2b8e760ff14d4691783eb7c7d341f093199aab82 /platformio/temphum/src/util.h
parent586d84b0c0a8b4dc1b5057733892b754397234ec (diff)
mqtt, esp: add new esp8266-based device
Diffstat (limited to 'platformio/temphum/src/util.h')
-rw-r--r--platformio/temphum/src/util.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/platformio/temphum/src/util.h b/platformio/temphum/src/util.h
new file mode 100644
index 0000000..e0780d8
--- /dev/null
+++ b/platformio/temphum/src/util.h
@@ -0,0 +1,13 @@
+#pragma once
+
+namespace homekit {
+
+inline size_t otaGetMaxUpdateSize() {
+ return (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000;
+}
+
+inline void restart() {
+ ESP.restart();
+}
+
+} \ No newline at end of file