39
39
#define USE_PLL_HSE_XTAL 0x4 // Use external xtal (X3 on board - not provided by default)
40
40
#define USE_PLL_HSI 0x2 // Use HSI internal clock
41
41
42
+ extern " C" uint8_t SetSysClock_PLL_HSE (uint8_t bypass, bool lowspeed);
43
+
42
44
volatile const uint8_t bootloader_data[] __attribute__ ((section (" .bootloader_version" ), used)) = {
43
45
BOOTLOADER_CONFIG_MAGIC,
44
46
BOOTLOADER_VERSION,
@@ -55,6 +57,10 @@ volatile const uint8_t bootloader_data[] __attribute__ ((section (".bootloader_v
55
57
56
58
volatile const uint8_t bootloader_identifier[] __attribute__ ((section (" .bootloader_identification" ), used)) = " MCUboot Arduino" ;
57
59
60
+ #if MCUBOOT_APPLICATION_DFU
61
+ USBD_HandleTypeDef USBD_Device;
62
+ #endif
63
+
58
64
DigitalOut red (BOARD_RED_LED, 1 );
59
65
DigitalOut green (BOARD_GREEN_LED, 1 );
60
66
DigitalOut blue (BOARD_BLUE_LED, 1 );
@@ -118,15 +124,6 @@ static int debug_init(void) {
118
124
return 0 ;
119
125
}
120
126
121
- #if MCUBOOT_APPLICATION_DFU
122
- USBD_HandleTypeDef USBD_Device;
123
- extern PCD_HandleTypeDef hpcd;
124
- #endif
125
-
126
- extern " C" {
127
- uint8_t SetSysClock_PLL_HSE (uint8_t bypass, bool lowspeed);
128
- }
129
-
130
127
static int start_dfu (void ) {
131
128
RTCSetBKPRegister (RTC_BKP_DR0, 0 );
132
129
@@ -168,7 +165,7 @@ static int start_dfu(void) {
168
165
#else // USE_USB_FS
169
166
if (USB_OTG_FS->GINTSTS & USB_OTG_FS->GINTMSK ) {
170
167
#endif
171
- HAL_PCD_IRQHandler (&hpcd );
168
+ HAL_PCD_IRQHandler (HAL_PCD_GetHandle () );
172
169
}
173
170
#endif
174
171
led_pulse (&green);
0 commit comments