From bf7a316b04a68e9f684cdc17514ff1d2da9221f9 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 9 Jul 2023 23:24:41 -0400 Subject: [PATCH] don't start flasher if already started --- graphics/core.lua | 2 +- graphics/flasher.lua | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/graphics/core.lua b/graphics/core.lua index d99ef3b..cff4ff5 100644 --- a/graphics/core.lua +++ b/graphics/core.lua @@ -7,7 +7,7 @@ local flasher = require("graphics.flasher") local core = {} -core.version = "1.0.0" +core.version = "1.0.1" core.flasher = flasher core.events = events diff --git a/graphics/flasher.lua b/graphics/flasher.lua index 520fba7..9412ac7 100644 --- a/graphics/flasher.lua +++ b/graphics/flasher.lua @@ -43,8 +43,10 @@ end -- start/resume the flasher periodic function flasher.run() - active = true - callback_250ms() + if not active then + active = true + callback_250ms() + end end -- clear all blinking indicators and stop the flasher periodic