summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-01-08 15:41:11 +0100
committerHarald Welte <laforge@gnumonks.org>2012-01-08 15:41:11 +0100
commitb3d3d2161c2d8ae685390b6d635ccc9e2a5df9aa (patch)
treeae774199d14e150718b8081806afef07326f7ce4
parent4b0a2a1aa2876199d00765a81c75bd8abd697e7d (diff)
DFU: toggle LED on upload and download
-rw-r--r--usb-dfu-experiment/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usb-dfu-experiment/main.c b/usb-dfu-experiment/main.c
index e9ef876..2fdd981 100644
--- a/usb-dfu-experiment/main.c
+++ b/usb-dfu-experiment/main.c
@@ -334,7 +334,9 @@ int USBDFU_handle_upload(uint8_t altif, unsigned int offset,
if (req_len < real_len)
real_len = req_len;
+ LED_Set(USBD_LEDOTHER);
memcpy(buf, addr, real_len);
+ LED_Clear(USBD_LEDOTHER);
return real_len;
}
@@ -368,7 +370,9 @@ int USBDFU_handle_dnload(uint8_t altif, unsigned int offset,
case ALTIF_FPGA:
/* SAM3U Errata 46.2.1.3 */
SetFlashWaitState(6);
+ LED_Set(USBD_LEDOTHER);
rc = FLASHD_Write(addr, buf, len);
+ LED_Clear(USBD_LEDOTHER);
/* SAM3U Errata 46.2.1.3 */
SetFlashWaitState(2);
if (rc != 0) {
personal git repositories of Harald Welte. Your mileage may vary