diff options
Diffstat (limited to 'libmaple')
| -rw-r--r-- | libmaple/usb/usb.c | 24 | ||||
| -rw-r--r-- | libmaple/usb/usb_config.h | 2 | 
2 files changed, 3 insertions, 23 deletions
| diff --git a/libmaple/usb/usb.c b/libmaple/usb/usb.c index 2fc4eb2..7b1dd4c 100644 --- a/libmaple/usb/usb.c +++ b/libmaple/usb/usb.c @@ -35,6 +35,7 @@  #include "usb_lib.h"  #include "gpio.h"  #include "usb_hardware.h" +#include "delay.h"  #include "usb_config.h"  #include "usb_callbacks.h" @@ -318,29 +319,8 @@ if (wIstr & ISTR_CTR & wInterrupt_Mask) {  } -static void FIXME_delayMicroseconds_copy(uint32 us) { -    /* So (2^32)/12 micros max, or less than 6 minutes */ -    us *= 12; - -    /* fudge for function call overhead  */ -    us--; -    asm volatile("   mov r0, %[us]          \n\t" -                 "1: subs r0, #1            \n\t" -                 "   bhi 1b                 \n\t" -                 : -                 : [us] "r" (us) -                 : "r0"); -} - -static void FIXME_delay_copy(unsigned long ms) { -    uint32 i; -    for (i = 0; i < ms; i++) { -        FIXME_delayMicroseconds_copy(1000); -    } -} -  void usbWaitReset(void) { -  FIXME_delay_copy(RESET_DELAY); +  delay_us(RESET_DELAY);    systemHardReset();  } diff --git a/libmaple/usb/usb_config.h b/libmaple/usb/usb_config.h index 0860b90..23b49ee 100644 --- a/libmaple/usb/usb_config.h +++ b/libmaple/usb/usb_config.h @@ -25,7 +25,7 @@   *****************************************************************************/  #define VCOM_ID_VENDOR            0x1EAF -#define RESET_DELAY               (100) +#define RESET_DELAY               (100000)  #define USB_CONFIG_MAX_POWER      (100 >> 1)  #if defined(BOARD_maple) || defined(BOARD_maple_RET6) | 
