From 22b27a66a5d930b251a147d963025a952044a932 Mon Sep 17 00:00:00 2001 From: pandx Date: Wed, 11 Dec 2024 11:01:38 +0800 Subject: [PATCH] add exception process. --- scheduler/schedule.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scheduler/schedule.cpp b/scheduler/schedule.cpp index 7731204..1e11093 100644 --- a/scheduler/schedule.cpp +++ b/scheduler/schedule.cpp @@ -207,6 +207,10 @@ int SensorScheduler::GetNextDuration(int short_addr) { long current_ts = GetLocalTs(); long next_ts = CalcNextTimestamp(id, short_addr); int duration = next_ts - current_ts; + if (duration <= 0 || duration > eigen_value_send_interval_) { + zlog_warn(zct, "[Nxt] exception duration: %d", duration); + duration = eigen_value_send_interval_; + } zlog_warn(zct, "[Nxt] [%d:%x] next duration is %d", id, short_addr, duration); return duration; }