stm32: stm32f4 usb boot check only needed when CONFIG_USBSERIAL

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2019-10-26 16:52:16 -04:00
parent 5da6a62759
commit 2ecc8d8f62
1 changed files with 2 additions and 2 deletions

View File

@ -209,10 +209,10 @@ clock_setup(void)
void
armcm_main(void)
{
if (*(uint64_t*)USB_BOOT_FLAG_ADDR == USB_BOOT_FLAG) {
if (CONFIG_USBSERIAL && *(uint64_t*)USB_BOOT_FLAG_ADDR == USB_BOOT_FLAG) {
*(uint64_t*)USB_BOOT_FLAG_ADDR = 0;
uint32_t *sysbase = (uint32_t*)0x1fff0000;
asm volatile("mov sp, %r0\n bx %r1"
asm volatile("mov sp, %0\n bx %1"
: : "r"(sysbase[0]), "r"(sysbase[1]));
}