17 bool initialized =
false;
31 constexpr
std::int32_t MaxUtcSpeedCorrectionX16 = 100 * 16;
45 CriticalSectionLocker lock;
72 time += USecPerOverflow;
75 return time + (cycles / cycles_per_usec);
91 CriticalSectionLocker locker;
106 CriticalSectionLocker locker;
120 prev_adjustment = adjustment.
toUSec();
122 utc_correction_usec_per_overflow_x16 += adjustment.
isPositive() ? 1 : -1;
123 utc_correction_usec_per_overflow_x16 += (adj_delta > 0) ? 1 : -1;
125 utc_correction_usec_per_overflow_x16 =
126 uavcan::max(utc_correction_usec_per_overflow_x16, -MaxUtcSpeedCorrectionX16);
127 utc_correction_usec_per_overflow_x16 =
128 uavcan::min(utc_correction_usec_per_overflow_x16, MaxUtcSpeedCorrectionX16);
134 CriticalSectionLocker locker;
147 utc_correction_usec_per_overflow_x16 = 0;
177 time_mono += USecPerOverflow;