From 5009e74a1e727e5a98991720f7664cd9e7eafc0b Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Thu, 6 Mar 2014 10:18:20 +0000 Subject: [PATCH] Added DFUDelay helper fund (endpoint 0 now in c so no timers... ) --- module_dfu/src/dfu.xc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/module_dfu/src/dfu.xc b/module_dfu/src/dfu.xc index 6792dad4..03d37a0a 100644 --- a/module_dfu/src/dfu.xc +++ b/module_dfu/src/dfu.xc @@ -3,7 +3,7 @@ #include "devicedefines.h" #include "xud.h" -#include "usb.h" +#include "usb_std_requests.h" #include "dfu_types.h" #include "flash_interface.h" @@ -22,6 +22,15 @@ extern int DFU_reset_override; extern void DFUCustomFlashEnable(); extern void DFUCustomFlashDisable(); +void DFUDelay(unsigned d) +{ + timer tmr; + unsigned s; + tmr :> s; + tmr when timerafter(s + d) :> void; +} + + void temp() { asm(".linkset DFU_reset_override, _edp.bss");