diff --git a/scheduler/schedule.cpp b/scheduler/schedule.cpp index 71e1903..b487848 100644 --- a/scheduler/schedule.cpp +++ b/scheduler/schedule.cpp @@ -293,6 +293,8 @@ int SensorScheduler::GetNextDuration(int short_addr, int &next_task_id) { id = iter->second; } long current_ts = GetLocalTs(); + nth_wave_start_slice_ = (current_ts_ - start_timestamp_) / wave_form_send_interval_; + current_wave_start_ts_ = nth_wave_start_slice_ * wave_form_send_interval_ + start_timestamp_; long next_ts = CalcNextTimestamp(id, short_addr, next_task_id); int duration = next_ts - current_ts; if (duration < 0 || duration > eigen_value_send_interval_) {