diff options
author | Aki <please@ignore.pl> | 2024-01-22 18:37:04 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2024-01-22 18:37:04 +0100 |
commit | 7b6c20b5c58014861e218e62cf0749bdd0ba727e (patch) | |
tree | 56101658210bc39d21631e7f1a90be363807d4d1 /run.lua | |
parent | 188b980b2597d39052004cb56277b1684df0007d (diff) | |
download | nodemcu-wakeup-7b6c20b5c58014861e218e62cf0749bdd0ba727e.zip nodemcu-wakeup-7b6c20b5c58014861e218e62cf0749bdd0ba727e.tar.gz nodemcu-wakeup-7b6c20b5c58014861e218e62cf0749bdd0ba727e.tar.bz2 |
Use a state machine to perform preparation and wakeups
Diffstat (limited to 'run.lua')
-rw-r--r-- | run.lua | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1,6 +1,11 @@ local wakeup = require("wakeup") return function () - wakeup:init() - tmr.create():alarm(1000, tmr.ALARM_SINGLE, function () wakeup:run() end) + tmr.create():alarm( + 500, + tmr.ALARM_AUTO, + function (timer) + wakeup:step(timer) + collectgarbage() + end) end |