aboutsummaryrefslogtreecommitdiff
path: root/include/pio/include/homekit/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/pio/include/homekit/util.h')
-rw-r--r--include/pio/include/homekit/util.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/pio/include/homekit/util.h b/include/pio/include/homekit/util.h
new file mode 100644
index 0000000..e0780d8
--- /dev/null
+++ b/include/pio/include/homekit/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