mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-09-28 21:01:06 +00:00
embassy-usb-dfu: fix: do not reset in GetStatus request
Only reset the device after a USB reset request. This avoids error messages with update tools, which expect a response to a GetStatus request (like dfu-util).
This commit is contained in:
parent
de33d113a5
commit
40f5161c32
@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
<!-- next-header -->
|
||||
## Unreleased - ReleaseDate
|
||||
|
||||
- changed: Do not reset in the GetStatus request
|
||||
|
||||
## 0.2.0 - 2025-08-27
|
||||
|
||||
- First release with changelog.
|
||||
|
@ -182,7 +182,7 @@ impl<'d, DFU: NorFlash, STATE: NorFlash, RST: Reset, const BLOCK_SIZE: usize> Ha
|
||||
Ok(Request::GetStatus) => {
|
||||
match self.state {
|
||||
State::DlSync => self.state = State::Download,
|
||||
State::ManifestSync => self.reset.sys_reset(),
|
||||
State::ManifestSync => self.state = State::ManifestWaitReset,
|
||||
_ => {}
|
||||
}
|
||||
|
||||
@ -201,6 +201,12 @@ impl<'d, DFU: NorFlash, STATE: NorFlash, RST: Reset, const BLOCK_SIZE: usize> Ha
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
fn reset(&mut self) {
|
||||
if matches!(self.state, State::ManifestSync | State::ManifestWaitReset) {
|
||||
self.reset.sys_reset()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// An implementation of the USB DFU 1.1 protocol
|
||||
|
Loading…
x
Reference in New Issue
Block a user