fix schedule bug.
This commit is contained in:
parent
99fa26d305
commit
0978d9e980
@ -456,9 +456,23 @@ int SensorScheduler::GetNextDuration(uint16_t short_addr, bool &z, int &next_tas
|
||||
} else {
|
||||
id = iter->second;
|
||||
}
|
||||
long current_ts = GetLocalTs();
|
||||
current_ts_ = GetLocalTs();
|
||||
// CleanIdleOccupiedSet(current_ts_);
|
||||
|
||||
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_;
|
||||
seconds_in_current_wave_slice_ = current_ts_ - current_wave_start_ts_;
|
||||
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;
|
||||
}
|
||||
|
||||
// long current_ts = GetLocalTs();
|
||||
long next_ts = CalcNextTimestamp(id, short_addr, z, next_task_id);
|
||||
int duration = next_ts - current_ts;
|
||||
int duration = next_ts - current_ts_;
|
||||
if (duration < 10) {
|
||||
zlog_debug(zbt, "[%d:%x] [Nxt] exception duration:%d, adjust to 25", id, short_addr,duration);
|
||||
duration = 25;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user