From 4ec9fbff018f6017b4f0d8ccc44a78c47a06fbbf Mon Sep 17 00:00:00 2001 From: coffee Date: Thu, 28 Aug 2025 16:31:59 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8D=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E5=99=A8=E6=97=B6=E8=B0=83=E7=94=A8=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/HTimer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/HTimer.c b/src/HTimer.c index 97ddd8d..5055f7d 100644 --- a/src/HTimer.c +++ b/src/HTimer.c @@ -137,11 +137,11 @@ void HTimerRun(uint8_t id) { } // 没必要每次都扫描, 当时间更新时再检查 - static uint32_t lastMs = 0; - if (lastMs == GetCurrentMs()) { + static uint32_t lastMs[HTIMER_REGISTER_MAX]; + if (lastMs[id] == GetCurrentMs()) { return ; } - lastMs = GetCurrentMs(); + lastMs[id] = GetCurrentMs(); for (uint16_t i = 0; i < sTimeRegisters[id].len; ++i) { if (sTimeRegisters[id].timers[i].enable == 0) {