diff --git a/scheduler/schedule.cpp b/scheduler/schedule.cpp index 54a315c..cb46aea 100644 --- a/scheduler/schedule.cpp +++ b/scheduler/schedule.cpp @@ -1243,7 +1243,7 @@ void SensorScheduler::GenerateDebugSchedule(std::vector short_addr_lis long current_ts = GetLocalTs(); long nth_wave_start_slice = (current_ts - start_timestamp_) / wave_form_send_interval_; long current_wave_start_ts = nth_wave_start_slice * wave_form_send_interval_ + start_timestamp_; - long seconds_in_current_wave_slice = current_ts_ - current_wave_start_ts; + long seconds_in_current_wave_slice = current_ts - current_wave_start_ts; long nth_eigen_value_slice = seconds_in_current_wave_slice / eigen_value_send_interval_; long seconds_in_current_eigen_slice = seconds_in_current_wave_slice % eigen_value_send_interval_; int previous_wave_slice = wave_slice_num_per_eigen_interval_ * (nth_eigen_value_slice + 1); @@ -1379,9 +1379,9 @@ void SensorScheduler::GenerateUpgradeSchedule() { int j = 0; // int k = 0; for (int i = previous_wave_slice+1; i < previous_wave_slice+1+available_slice_; i=i+2) { - j = i % available_slice_+1; + j = i % available_slice_; if (j == 0) { - j = 1; + j = i; } zlog_debug(zbt, "i = %d, j = %d", i, j); // k = k % upgrade_size; @@ -1392,9 +1392,9 @@ void SensorScheduler::GenerateUpgradeSchedule() { int j = 0; int k = 0; for (int i = previous_wave_slice+1; i < previous_wave_slice+1+available_slice_; ++i) { - j = i % available_slice_+1; + j = i % available_slice_; if (j == 0) { - j = 1; + j = i; } k = k % upgrade_size; upgrade_slice_sensor_id_[j] = short_addr_list[k];