fix upgrade schedule bug.
This commit is contained in:
parent
3ed6961b81
commit
49b67921c5
@ -1243,7 +1243,7 @@ void SensorScheduler::GenerateDebugSchedule(std::vector<uint16_t> short_addr_lis
|
|||||||
long current_ts = GetLocalTs();
|
long current_ts = GetLocalTs();
|
||||||
long nth_wave_start_slice = (current_ts - start_timestamp_) / wave_form_send_interval_;
|
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 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 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_;
|
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);
|
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 j = 0;
|
||||||
// int k = 0;
|
// int k = 0;
|
||||||
for (int i = previous_wave_slice+1; i < previous_wave_slice+1+available_slice_; i=i+2) {
|
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) {
|
if (j == 0) {
|
||||||
j = 1;
|
j = i;
|
||||||
}
|
}
|
||||||
zlog_debug(zbt, "i = %d, j = %d", i, j);
|
zlog_debug(zbt, "i = %d, j = %d", i, j);
|
||||||
// k = k % upgrade_size;
|
// k = k % upgrade_size;
|
||||||
@ -1392,9 +1392,9 @@ void SensorScheduler::GenerateUpgradeSchedule() {
|
|||||||
int j = 0;
|
int j = 0;
|
||||||
int k = 0;
|
int k = 0;
|
||||||
for (int i = previous_wave_slice+1; i < previous_wave_slice+1+available_slice_; ++i) {
|
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) {
|
if (j == 0) {
|
||||||
j = 1;
|
j = i;
|
||||||
}
|
}
|
||||||
k = k % upgrade_size;
|
k = k % upgrade_size;
|
||||||
upgrade_slice_sensor_id_[j] = short_addr_list[k];
|
upgrade_slice_sensor_id_[j] = short_addr_list[k];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user