declare variables so the main loop can read the data to be flashed provided by the USB stack

Change-Id: I092357aad95abef1a781be1ea77944f2ea523dab
This commit is contained in:
Kevin Redon 2019-01-03 18:10:53 +01:00
parent d25509abca
commit 2f8fcbbef6
2 changed files with 25 additions and 2 deletions

View File

@ -34,8 +34,13 @@ struct dfudf_func_data {
static struct usbdf_driver _dfudf;
static struct dfudf_func_data _dfudf_funcd;
static enum usb_dfu_state dfu_state = USB_DFU_STATE_DFU_IDLE; /**< current DFU state */
static enum usb_dfu_status dfu_status = USB_DFU_STATUS_OK; /**< current DFU status */
enum usb_dfu_state dfu_state = USB_DFU_STATE_DFU_IDLE;
enum usb_dfu_status dfu_status = USB_DFU_STATUS_OK;
uint8_t dfu_download_data[512];
uint16_t dfu_download_length = 0;
size_t dfu_download_progress = 0;
bool dfu_manifestation_complete = false;
/**
* \brief Enable DFU Function

View File

@ -35,6 +35,24 @@
#define USBDF_DFU_H_
#include "usbdc.h"
#include "usb_protocol_dfu.h"
/** Current DFU state */
extern enum usb_dfu_state dfu_state;
/**< Current DFU status */
extern enum usb_dfu_status dfu_status;
/** Downloaded data to be programmed in flash
*
* 512 is the flash page size of the SAM D5x/E5x
*/
extern uint8_t dfu_download_data[512];
/** Length of downloaded data in bytes */
extern uint16_t dfu_download_length;
/** Progress of the already downloaded data in bytes */
extern size_t dfu_download_progress;
/** If manifestation (firmware flash and check) is complete */
extern bool dfu_manifestation_complete;
/**
* \brief Initialize the USB DFU Function Driver