Browse Source

Fix overflow in delay (#40)

Gets checked in debug builds
trying.tmp
david-sawatzke 4 years ago committed by Daniel Egger
parent
commit
b2111b98b0
  1. 4
      CHANGELOG.md
  2. 2
      src/delay.rs

4
CHANGELOG.md

@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Support for STM32F091 - @jessebraham
- Support for HSE as a system clocksource (#25 - breaking change) - @zklapow
### Fixed
- Fixed panic in delay overflow handling for debug builds - @david-sawatzke
## [v0.11.1] - 2019-01-05
### Added

2
src/delay.rs

@ -99,7 +99,7 @@ impl DelayUs<u32> for Delay {
let start_count = SYST::get_current();
total_rvr -= current_rvr;
while ((start_count - SYST::get_current()) % MAX_SYSTICK) < current_rvr {}
while (start_count.wrapping_sub(SYST::get_current()) % MAX_SYSTICK) < current_rvr {}
}
}
}

Loading…
Cancel
Save