Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rp2040: add barrier in usb_read_ep0_setup
Some versions of gcc, in some cases, decide that it is OK to move the read to `INTR` to right after clearing the `SETUP_REC` bit of `SIE_STATUS`, instead of after the `memcpy`. The rp2040 datasheet doesn't appear to say anything about how quickly the `SETUP_REC` bit will be cleared in `INTR`, but regardless the compiler should not be re-ordering the read like this. Here we force the correct ordering using a memory barrier. Signed-off-by: Lasse Dalegaard <[email protected]>
- Loading branch information