Skip to content

Commit df014ff

Browse files
ALTracerdragonmux
authored andcommitted
platforms/blackpill-f4: DFU cleanup
* Reset unnecessary braces change * Drop last unneeded `#pragma`s * Add a clarification on reboot flows
1 parent 995a788 commit df014ff

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/platforms/common/blackpill-f4/blackpill-f4.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,18 @@ const char *platform_target_voltage(void)
131131
return NULL;
132132
}
133133

134-
#pragma GCC diagnostic push
135-
#pragma GCC diagnostic ignored "-Warray-bounds"
136-
134+
/*
135+
* Write the bootloader flag and reboot.
136+
* The platform_init() will see this and reboot a second time into ST BootROM.
137+
* If BMPBootloader is enabled, then it will see this and initialize its DFU.
138+
*/
137139
void platform_request_boot(void)
138140
{
139141
magic[0] = BOOTMAGIC0;
140142
magic[1] = BOOTMAGIC1;
141143
scb_reset_system();
142144
}
143145

144-
#pragma GCC diagnostic pop
145-
146146
#ifdef PLATFORM_HAS_POWER_SWITCH
147147
bool platform_target_get_power(void)
148148
{

src/platforms/common/blackpill-f4/usbdfu.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ int main(void)
4646
if (!gpio_get(GPIOA, GPIO0) || (magic[0] == BOOTMAGIC0 && magic[1] == BOOTMAGIC1)) {
4747
magic[0] = 0;
4848
magic[1] = 0;
49-
} else {
49+
} else
5050
dfu_jump_app_if_valid();
51-
}
5251

5352
rcc_clock_setup_pll(&rcc_hse_25mhz_3v3[PLATFORM_CLOCK_FREQ]);
5453

0 commit comments

Comments
 (0)