agausmann / atmega-usbd

Rust usb-device support for ATmega chips
BSD Zero Clause License
27 stars 10 forks source link

lib: add a UsbBus::force_reset implementation #13

Closed rmsyn closed 1 year ago

rmsyn commented 1 year ago

Implements the force_reset function for usb_device::UsbBus, that simply sets the UDCON::detach bit.

agausmann commented 1 year ago

@rmsyn Are you able to test this change?

Since I don't have permission to push to your branch, I updated it here: agausmann:feature/detach 875493126cc04e1dd229a83085de934f4660c18c

rmsyn commented 1 year ago

Are you able to test this change?

I'm getting pretty close to being able to run the firmware on real hardware. I'll use your changes, and provide updates on how it works.

FWIW, it looks good to me, and passes the build test.

Since I don't have permission to push to your branch, I updated it here: agausmann:feature/detach https://github.com/agausmann/atmega-usbd/commit/875493126cc04e1dd229a83085de934f4660c18c

I changed to allow edits from maintainers, and cherry-picked your changes. Let me know if you want me to drop the cherry-pick, so you can add it yourself.

agausmann commented 1 year ago

Alright, the delay_cycles method will be added to avr-device in its next release

agausmann commented 1 year ago

I actually haven't tested the delay yet. :sweat_smile: I will write a blinky using it later today. Although the generated assembly looks good

agausmann commented 1 year ago

Merged as bdbc13dfdb1300565645668277ac32a7a6914d1f