From 7b6c20b5c58014861e218e62cf0749bdd0ba727e Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 22 Jan 2024 18:37:04 +0100 Subject: Use a state machine to perform preparation and wakeups --- run.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'run.lua') diff --git a/run.lua b/run.lua index 43f7cad..e5a7627 100644 --- a/run.lua +++ b/run.lua @@ -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 -- cgit v1.1