Attention is currently required from: lynxis lazus.
pespin has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-asf4-dfu/+/42174?usp=email )
Change subject: dfu: rewrite firmware downloading ......................................................................
Patch Set 2:
(3 comments)
File usb/class/dfu/device/dfudf.c:
https://gerrit.osmocom.org/c/osmo-asf4-dfu/+/42174/comment/88d2526a_8eb7d9bc... : PS2, Line 246: if (!(usb_dfu_func_desc->bmAttributes & USB_REQ_DFU_DNLOAD)) { // download is not enabled Moving this whole block into a function with early returns may make the code a lot easier to follow.
In that case you can also drop the "else if" and have them as "if".
Actually, you can already remove the "else if" now and have them as "if" in here?
File usb_start.c:
https://gerrit.osmocom.org/c/osmo-asf4-dfu/+/42174/comment/0ef86264_e459cb66... : PS2, Line 171: /* FIXME: check if dfu_download_offset / length are valid */ is this related to the changes in this commit?
https://gerrit.osmocom.org/c/osmo-asf4-dfu/+/42174/comment/cf4cfe39_170c5463... : PS2, Line 178: CRITICAL_SECTION_ENTER(); why do you need the critical section here exactly? to increment dfu_download_offset?