BDMA: request stop after busy loop in blocking_wait().

Otherwise the channel cannot be used again, since CR.EN remains set
and the DMA channel registers are read-only while it is set.
This commit is contained in:
Catherine 2023-06-19 09:06:41 +00:00
parent ec36225f8a
commit bbc81146ec

View File

@ -327,6 +327,7 @@ impl<'a, C: Channel> Transfer<'a, C> {
pub fn blocking_wait(mut self) { pub fn blocking_wait(mut self) {
while self.is_running() {} while self.is_running() {}
self.request_stop();
// "Subsequent reads and writes cannot be moved ahead of preceding reads." // "Subsequent reads and writes cannot be moved ahead of preceding reads."
fence(Ordering::SeqCst); fence(Ordering::SeqCst);