imxrt-rs / imxrt-usbd

USB device driver for i.MX RT processors
Apache License 2.0
7 stars 9 forks source link

Re-evaluate in-memory ep_out bitmask #16

Open mciantyre opened 2 years ago

mciantyre commented 2 years ago

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 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].

mciantyre commented 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.