Open mciantyre opened 2 years ago
Nevermind, I remember now. Had to read that comment a few times.
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.
https://github.com/imxrt-rs/imxrt-usbd/blob/4c97f656ab39cc96141894f5a91daf231f7a064f/src/full_speed/driver.rs#L53-L62
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 inERCE
untilep_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]
.