Re-evaluate in-memory ep_out bitmask
mciantyre opened this issue · 1 comments
imxrt-usbd/src/full_speed/driver.rs
Lines 53 to 62 in 4c97f65
I don't remember why we couldn't keep this state in ENDPTCOMPLETE[ERCE]
. After a second glance, it seems like we could drop this bitmask and maintain the state in the registers. The flags persist in ERCE
until ep_read
returns data to the caller and schedules the next OUT transfer.
Figure out if this bitmask is still necessary. If it is necessary, add a comment to clarify why we can't keep the flags in ENDPTCOMPLETE[ERCE]
.
Nevermind, I remember now. Had to read that comment a few times.
- poll() called, no ep_out bit set.
- Device receives OUT packet with data.
- Something reads the endpoint, and finds data.
The mask hides the fact that the driver could receive data before poll() is called. From these notes, it sounds like the test class treats that as an error. I'm not sure why.