rust-exercises icon indicating copy to clipboard operation
rust-exercises copied to clipboard

Clean up USB exercise

Open jonathanpallant opened this issue 1 year ago • 2 comments

  • [ ] "HEADS UP to use your USB packet parser uncomment line 12 and remove line 13" those line numbers are wrong
  • [x] "SETUP: bmrequesttype: {}, brequest: {}, wlength: {}, windex: {}, wvalue: {}" could use some better formatting
  • [ ] consts::VID should be consts::USB_VID_DEMO
  • [ ] consts::PID should be consts::USB_PID_RTIC_DEMO
  • [ ] We should use pid.codes Test PIDs, like 0x000A, 0x000B and 0x000C, not random ones (we might collide with another pid.codes product in the future)
  • [ ] fn on_event et al, don't need to be inside the macro
  • [ ] the usbd module could be a struct with methods. Then people won't be tempted to try and read the registers by hand, when there are methods that do it for them.

jonathanpallant avatar Dec 06 '24 16:12 jonathanpallant

The formatting of the messages is better in #152

jonathanpallant avatar Dec 12 '24 12:12 jonathanpallant

the usbd module could be a struct with methods. Then people won't be tempted to try and read the registers by hand, when there are methods that do it for them.

Or really, we could use the usb-device crate to do most of the heavy lifting. Then all the attendees need to do is share a usb-device with a task bound to USBD, and call usb_device.poll(). This is what the dongle firmware now does.

jonathanpallant avatar Dec 12 '24 14:12 jonathanpallant