Merge pull request #3724 from CNLHC/qspi_waiting_condition

FIX: QSPI synchronous read operation hangs when FIFO is not full
This commit is contained in:
Dario Nieuwenhuis 2025-01-07 20:38:51 +00:00 committed by GitHub
commit 7c3099b9e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -172,7 +172,7 @@ impl<'d, T: Instance, M: PeriMode> Qspi<'d, T, M> {
});
for b in buf {
while !T::REGS.sr().read().tcf() && !T::REGS.sr().read().ftf() {}
while !T::REGS.sr().read().tcf() && (T::REGS.sr().read().flevel() == 0) {}
*b = unsafe { (T::REGS.dr().as_ptr() as *mut u8).read_volatile() };
}