Round up in delay_nanos (#2256)
This commit is contained in:
parent
fcc6375ba5
commit
487de0ff22
@ -77,6 +77,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- PARL_IO: Fixed an issue that caused garbage to be output at the start of some requests (#2211)
|
- PARL_IO: Fixed an issue that caused garbage to be output at the start of some requests (#2211)
|
||||||
- TWAI on ESP32 (#2207)
|
- TWAI on ESP32 (#2207)
|
||||||
- TWAI should no longer panic when receiving a non-compliant frame (#2255)
|
- TWAI should no longer panic when receiving a non-compliant frame (#2255)
|
||||||
|
- OneShotTimer: fixed `delay_nanos` behaviour (#2256)
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
|||||||
@ -138,7 +138,7 @@ where
|
|||||||
|
|
||||||
/// Pauses execution for *at least* `ns` nanoseconds.
|
/// Pauses execution for *at least* `ns` nanoseconds.
|
||||||
pub fn delay_nanos(&self, ns: u32) {
|
pub fn delay_nanos(&self, ns: u32) {
|
||||||
self.delay((ns as u64 / 1000).micros())
|
self.delay((ns.div_ceil(1000) as u64).micros())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn delay(&self, us: MicrosDurationU64) {
|
fn delay(&self, us: MicrosDurationU64) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user