We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Delay
1 parent b2be3f9 commit 21a4163Copy full SHA for 21a4163
avr-hal-generic/src/delay.rs
@@ -301,7 +301,7 @@ impl<SPEED> DelayNs for Delay<SPEED>
301
fn delay_ns(&mut self, ns: u32) {
302
// quick-win to get an initial implementation.
303
// note that the trait does not guarantee nanosecond-accuracy.
304
- delay_v0::DelayUs::<u32>::delay_us(self, ns.saturating_add(999) / 1000)
+ delay_v0::DelayUs::<u32>::delay_us(self, ns.div_ceil(1000))
305
}
306
307
fn delay_us(&mut self, us: u32) {
0 commit comments