From 725b3ade9e11c3e01b28758d3e84ee75654b5228 Mon Sep 17 00:00:00 2001 From: zhangsheng Date: Mon, 16 Mar 2026 14:08:00 +0800 Subject: [PATCH] fix bugs --- scheduler/schedule.cpp | 3 --- uart/uart.cpp | 8 +++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/scheduler/schedule.cpp b/scheduler/schedule.cpp index bbc99d0..8249d01 100644 --- a/scheduler/schedule.cpp +++ b/scheduler/schedule.cpp @@ -26,7 +26,6 @@ int SensorScheduler::StartSchedule(uint16_t short_addr, int &next_duration, bool } else { id = iter->second; } - current_ts_ = GetLocalTs(); CleanIdleOccupiedSet(current_ts_); @@ -36,11 +35,9 @@ int SensorScheduler::StartSchedule(uint16_t short_addr, int &next_duration, bool nth_eigen_value_slice_ = seconds_in_current_wave_slice_ / eigen_value_send_interval_; seconds_in_current_eigen_slice_ = seconds_in_current_wave_slice_ % eigen_value_send_interval_; ts_in_eigen_slice_ = false; - if (seconds_in_current_eigen_slice_ < 60 - 3) { ts_in_eigen_slice_ = true; } - if (ts_in_eigen_slice_) { nth_eigen_slice_ = (seconds_in_current_eigen_slice_ + 2) / eigen_value_send_duration_; if (nth_eigen_value_slice_ == 0) { diff --git a/uart/uart.cpp b/uart/uart.cpp index a80b03e..e361d55 100644 --- a/uart/uart.cpp +++ b/uart/uart.cpp @@ -349,11 +349,14 @@ int Uart::DealAskTask(uint16_t ushortAdd){ zlog_warn(zct, "device info not found %02x%02x ", UINT16_HIGH(ushortAdd),UINT16_LOW(ushortAdd)); return 1; } - int next_duration = 0,next_task_id = 0; + int next_task_id = 0; int taskID; ScheduleTask scheduleTask; bool z = false; - taskID = scheduler::instance().StartSchedule(ushortAdd,next_duration,z, next_task_id); + //taskID = scheduler::instance().StartSchedule(ushortAdd,next_duration,z, next_task_id); + uint16_t next_duration = scheduler::instance().GetNextDuration(ushortAdd,z,next_task_id); + zlog_info(zct, "next_duration = %d next_taskID = %d,z = %d", next_duration,next_task_id,z); + current_z = z; zlog_info(zct, "taskID = %d next_duration = %d next_task_id = %d,current_z = %d", taskID, next_duration, next_task_id,current_z); if (taskID == kScheduleConfigSensor) @@ -386,7 +389,6 @@ int Uart::DealAskTask(uint16_t ushortAdd){ scheduleTask.next_taskID = UPGRADE; TaskResp(scheduleTask); } - DealReviveDuration(ushortAdd); // if (next_task_id == kScheduleEigenValue) //1.特征值 // {