diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-06-27 02:12:06 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2023-06-27 02:12:06 +0200 |
| commit | a575e40a3503f4bf500b7ee3cadcce44727c7c6f (patch) | |
| tree | 660eff62e3ed552e2e7cf9a476f77f6577890353 | |
| parent | 28fb492c402c74add5c650b9d65687816585c923 (diff) | |
stm32/otg: clear NAK bit on endpoint enable.
| -rw-r--r-- | embassy-stm32/src/usb_otg/usb.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/embassy-stm32/src/usb_otg/usb.rs b/embassy-stm32/src/usb_otg/usb.rs index 532157e6c..1a0d44fd2 100644 --- a/embassy-stm32/src/usb_otg/usb.rs +++ b/embassy-stm32/src/usb_otg/usb.rs | |||
| @@ -780,13 +780,14 @@ impl<'d, T: Instance> embassy_usb_driver::Bus for Bus<'d, T> { | |||
| 780 | // cancel transfer if active | 780 | // cancel transfer if active |
| 781 | if !enabled && r.diepctl(ep_addr.index()).read().epena() { | 781 | if !enabled && r.diepctl(ep_addr.index()).read().epena() { |
| 782 | r.diepctl(ep_addr.index()).modify(|w| { | 782 | r.diepctl(ep_addr.index()).modify(|w| { |
| 783 | w.set_snak(true); | 783 | w.set_snak(true); // set NAK |
| 784 | w.set_epdis(true); | 784 | w.set_epdis(true); |
| 785 | }) | 785 | }) |
| 786 | } | 786 | } |
| 787 | 787 | ||
| 788 | r.diepctl(ep_addr.index()).modify(|w| { | 788 | r.diepctl(ep_addr.index()).modify(|w| { |
| 789 | w.set_usbaep(enabled); | 789 | w.set_usbaep(enabled); |
| 790 | w.set_cnak(enabled); // clear NAK that might've been set by SNAK above. | ||
| 790 | }) | 791 | }) |
| 791 | }); | 792 | }); |
| 792 | 793 | ||
