lpc176x: refactor usbserial to use udelay helper.

Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
This commit is contained in:
Matt Baker 2019-04-06 15:20:00 -07:00 committed by KevinOConnor
parent e83071c9fe
commit 38f3d65ac5
1 changed files with 1 additions and 3 deletions

View File

@ -252,9 +252,7 @@ usb_request_bootloader(void)
// Disable USB and pause for 5ms so host recognizes a disconnect // Disable USB and pause for 5ms so host recognizes a disconnect
irq_disable(); irq_disable();
sie_cmd_write(SIE_CMD_SET_DEVICE_STATUS, 0); sie_cmd_write(SIE_CMD_SET_DEVICE_STATUS, 0);
uint32_t end = timer_read_time() + timer_from_us(5000); udelay(5000);
while (timer_is_before(timer_read_time(), end))
;
// The "LPC17xx-DFU-Bootloader" will enter the bootloader if the // The "LPC17xx-DFU-Bootloader" will enter the bootloader if the
// watchdog timeout flag is set. // watchdog timeout flag is set.
LPC_WDT->WDMOD = 0x07; LPC_WDT->WDMOD = 0x07;