laforge submitted this change.

View Change



4 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.

Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved
dfu: MANIFEST_SYNC: stay in MANIFEST_SYNC when manifestationIntolerant & completed

In theory a device which is manifestintolerant and completed the manifestation should
not reach MANIFEST_SYNC again.

Remove the state transistion to WAIT-RESET and stay in the current state and
wait for the main loop to change the state is safer.

Change-Id: I8c34a18e2336731126a8c01070d86e2547578e3d
---
M usb/class/dfu/device/dfudf.c
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/usb/class/dfu/device/dfudf.c b/usb/class/dfu/device/dfudf.c
index 76dcc9b..f931260 100644
--- a/usb/class/dfu/device/dfudf.c
+++ b/usb/class/dfu/device/dfudf.c
@@ -167,12 +167,15 @@
dfu_state = USB_DFU_STATE_DFU_DNBUSY; // switch to busy state
break;
case USB_DFU_STATE_DFU_MANIFEST_SYNC:
- if (!dfu_manifestation_complete) {
+ if (dfu_manifestation_complete) {
+ if (usb_dfu_func_desc->bmAttributes & USB_DFU_ATTRIBUTES_MANIFEST_TOLERANT) {
+ dfu_state = USB_DFU_STATE_DFU_IDLE; // go back to idle mode
+ }
+ /* Otherwise stay in MANIFEST_SYNC. Hower this his should not happen (after manifestation
+ * the state should be dfuMANIFEST-WAIT-RESET if we are not manifest tolerant)
+ */
+ } else {
dfu_state = USB_DFU_STATE_DFU_MANIFEST; // go to manifest mode
- } else if (usb_dfu_func_desc->bmAttributes & USB_DFU_ATTRIBUTES_MANIFEST_TOLERANT) {
- dfu_state = USB_DFU_STATE_DFU_IDLE; // go back to idle mode
- } else { // this should not happen (after manifestation the state should be dfuMANIFEST-WAIT-RESET if we are not manifest tolerant)
- dfu_state = USB_DFU_STATE_DFU_MANIFEST_WAIT_RESET; // wait for reset
}
break;
default:

To view, visit change 42175. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: osmo-asf4-dfu
Gerrit-Branch: master
Gerrit-Change-Id: I8c34a18e2336731126a8c01070d86e2547578e3d
Gerrit-Change-Number: 42175
Gerrit-PatchSet: 6
Gerrit-Owner: lynxis lazus <lynxis@fe80.eu>
Gerrit-Reviewer: Hoernchen <ewild@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>