<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/12505">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">declare variables so the main loop can read the data to be flashed provided by the USB stack<br><br>Change-Id: I092357aad95abef1a781be1ea77944f2ea523dab<br>---<br>M usb/class/dfu/device/dfudf.c<br>M usb/class/dfu/device/dfudf.h<br>2 files changed, 25 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/usb/class/dfu/device/dfudf.c b/usb/class/dfu/device/dfudf.c</span><br><span>index f3286a1..15a89fc 100644</span><br><span>--- a/usb/class/dfu/device/dfudf.c</span><br><span>+++ b/usb/class/dfu/device/dfudf.c</span><br><span>@@ -34,8 +34,13 @@</span><br><span> static struct usbdf_driver _dfudf;</span><br><span> static struct dfudf_func_data _dfudf_funcd;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static enum usb_dfu_state dfu_state = USB_DFU_STATE_DFU_IDLE; /**< current DFU state */</span><br><span style="color: hsl(0, 100%, 40%);">-static enum usb_dfu_status dfu_status = USB_DFU_STATUS_OK; /**< current DFU status */</span><br><span style="color: hsl(120, 100%, 40%);">+enum usb_dfu_state dfu_state = USB_DFU_STATE_DFU_IDLE;</span><br><span style="color: hsl(120, 100%, 40%);">+enum usb_dfu_status dfu_status = USB_DFU_STATUS_OK;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+uint8_t dfu_download_data[512];</span><br><span style="color: hsl(120, 100%, 40%);">+uint16_t dfu_download_length = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+size_t dfu_download_progress = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+bool dfu_manifestation_complete = false;</span><br><span> </span><br><span> /**</span><br><span>  * \brief Enable DFU Function</span><br><span>diff --git a/usb/class/dfu/device/dfudf.h b/usb/class/dfu/device/dfudf.h</span><br><span>index ba5cdd5..a19b569 100644</span><br><span>--- a/usb/class/dfu/device/dfudf.h</span><br><span>+++ b/usb/class/dfu/device/dfudf.h</span><br><span>@@ -35,6 +35,24 @@</span><br><span> #define USBDF_DFU_H_</span><br><span> </span><br><span> #include "usbdc.h"</span><br><span style="color: hsl(120, 100%, 40%);">+#include "usb_protocol_dfu.h"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/** Current DFU state */</span><br><span style="color: hsl(120, 100%, 40%);">+extern enum usb_dfu_state dfu_state;</span><br><span style="color: hsl(120, 100%, 40%);">+/**< Current DFU status */</span><br><span style="color: hsl(120, 100%, 40%);">+extern enum usb_dfu_status dfu_status;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/** Downloaded data to be programmed in flash</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ *  512 is the flash page size of the SAM D5x/E5x</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+extern uint8_t dfu_download_data[512];</span><br><span style="color: hsl(120, 100%, 40%);">+/** Length of downloaded data in bytes */</span><br><span style="color: hsl(120, 100%, 40%);">+extern uint16_t dfu_download_length;</span><br><span style="color: hsl(120, 100%, 40%);">+/** Progress of the already downloaded data in bytes */</span><br><span style="color: hsl(120, 100%, 40%);">+extern size_t dfu_download_progress;</span><br><span style="color: hsl(120, 100%, 40%);">+/** If manifestation (firmware flash and check) is complete */</span><br><span style="color: hsl(120, 100%, 40%);">+extern bool dfu_manifestation_complete;</span><br><span> </span><br><span> /**</span><br><span>  * \brief Initialize the USB DFU Function Driver</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12505">change 12505</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/12505"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-asf4-dfu </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I092357aad95abef1a781be1ea77944f2ea523dab </div>
<div style="display:none"> Gerrit-Change-Number: 12505 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Kévin Redon <kredon@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>