38
38
#define USE_PLL_HSE_XTAL 0x4 // Use external xtal (X3 on board - not provided by default)
39
39
#define USE_PLL_HSI 0x2 // Use HSI internal clock
40
40
41
+ extern " C" uint8_t SetSysClock_PLL_HSE (uint8_t bypass, bool lowspeed);
42
+
41
43
volatile const uint8_t bootloader_data[] __attribute__ ((section (" .bootloader_version" ), used)) = {
42
44
BOOTLOADER_CONFIG_MAGIC,
43
45
BOOTLOADER_VERSION,
@@ -54,6 +56,10 @@ volatile const uint8_t bootloader_data[] __attribute__ ((section (".bootloader_v
54
56
55
57
volatile const uint8_t bootloader_identifier[] __attribute__ ((section (" .bootloader_identification" ), used)) = " MCUboot Arduino" ;
56
58
59
+ #if MCUBOOT_APPLICATION_DFU
60
+ USBD_HandleTypeDef USBD_Device;
61
+ #endif
62
+
57
63
DigitalOut red (BOARD_RED_LED, 1 );
58
64
DigitalOut green (BOARD_GREEN_LED, 1 );
59
65
DigitalOut blue (BOARD_BLUE_LED, 1 );
@@ -135,15 +141,6 @@ static int debug_init(void) {
135
141
return 0 ;
136
142
}
137
143
138
- #if MCUBOOT_APPLICATION_DFU
139
- USBD_HandleTypeDef USBD_Device;
140
- extern PCD_HandleTypeDef hpcd;
141
- #endif
142
-
143
- extern " C" {
144
- uint8_t SetSysClock_PLL_HSE (uint8_t bypass, bool lowspeed);
145
- }
146
-
147
144
static int start_dfu (void ) {
148
145
RTCSetBKPRegister (RTC_BKP_DR0, 0 );
149
146
@@ -185,7 +182,7 @@ static int start_dfu(void) {
185
182
#else // USE_USB_FS
186
183
if (USB_OTG_FS->GINTSTS & USB_OTG_FS->GINTMSK ) {
187
184
#endif
188
- HAL_PCD_IRQHandler (&hpcd );
185
+ HAL_PCD_IRQHandler (HAL_PCD_GetHandle () );
189
186
}
190
187
#endif
191
188
led_pulse (&green);
0 commit comments