stm32: Check for CONFIG_HAVE_BOOTLOADER_REQUEST in dfu_reboot.c

Support disabling dfu_reboot if HAVE_BOOTLOADER_REQUEST is disabled in
the Kconfig rules.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2022-12-19 12:11:43 -05:00
parent b51b068442
commit 1ff0a5494a
1 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@
void void
dfu_reboot(void) dfu_reboot(void)
{ {
if (!CONFIG_STM32_DFU_ROM_ADDRESS) if (!CONFIG_STM32_DFU_ROM_ADDRESS || !CONFIG_HAVE_BOOTLOADER_REQUEST)
return; return;
irq_disable(); irq_disable();
uint64_t *bflag = (void*)USB_BOOT_FLAG_ADDR; uint64_t *bflag = (void*)USB_BOOT_FLAG_ADDR;
@ -46,7 +46,7 @@ dfu_reboot(void)
void void
dfu_reboot_check(void) dfu_reboot_check(void)
{ {
if (!CONFIG_STM32_DFU_ROM_ADDRESS) if (!CONFIG_STM32_DFU_ROM_ADDRESS || !CONFIG_HAVE_BOOTLOADER_REQUEST)
return; return;
if (*(uint64_t*)USB_BOOT_FLAG_ADDR != USB_BOOT_FLAG) if (*(uint64_t*)USB_BOOT_FLAG_ADDR != USB_BOOT_FLAG)
return; return;