japaric / stm32f103xx-hal

HAL for the STM32F103xx family of microcontrollers
Apache License 2.0
115 stars 40 forks source link

Fixed invalid RVR value when creating a delay #103

Closed gbip closed 5 years ago

gbip commented 5 years ago

This fix originates from this discussion. Thanks @jamesmunns

jamesmunns commented 5 years ago

@gbip you need to update the following as well for full correctness:

let current_rvr = if total_rvr < MAX_RVR

should be

let current_rvr = if total_rvr <= MAX_RVR

jamesmunns commented 5 years ago

Note: This fix would close #104

TeXitoi commented 5 years ago

@therealprof simple and important fix, can you merge it?