From 4dbf6df59fd930727368dd558cc8b83e9750edb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Mon, 29 Oct 2018 12:30:23 +0100 Subject: [PATCH] DFU: update call to match library --- lib/usb_dfu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/usb_dfu.c b/lib/usb_dfu.c index 1357d5f..754d85a 100644 --- a/lib/usb_dfu.c +++ b/lib/usb_dfu.c @@ -157,7 +157,7 @@ static void usb_dfu_flash(usbd_device *usbd_dev, struct usb_setup_data *req) (void)usbd_dev; // variable not used (void)req; // variable not used led_off(); // indicate we are processing - if (0 != flash_internal_write(flash_pointer, download_data, download_length, true)) { // write downloaded data + if (flash_internal_write(flash_pointer, download_data, download_length, true) >= download_length) { // write downloaded data flash_pointer += download_length; // go to next segment usb_dfu_state = STATE_DFU_DNLOAD_IDLE; // go back to idle stat to wait for next segment } else { // warn about writing error