stm32-rs / stm32l0xx-hal

A hardware abstraction layer (HAL) for the STM32L0 series microcontrollers written in Rust
BSD Zero Clause License
96 stars 60 forks source link

fix improper reporting of DMA overruns when remaining bytes is outside the expected range #126

Closed electroCutie closed 4 years ago

electroCutie commented 4 years ago

I've witnessed zeros as well as values larger than the initial setting, albeit spuriously. Added a saturating subtraction and a modulo to the position calculation and overrun now seems to be working correctly

There still seems to be more overruns than should strictly be happening, but I've been unable to pin them down and they disappear when clocking low enough. They might even be real but it is difficult to know. But this fix is solid

Fix for #125

hannobraun commented 4 years ago

Thank you, @electroCutie. I've left a comment in your commit. Some additional notes: