Round up in delay_nanos (#2256)

This commit is contained in:
Dániel Buga 2024-09-30 15:23:31 +02:00 committed by GitHub
parent fcc6375ba5
commit 487de0ff22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -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

View File

@ -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) {