Skip to content

Commit 45fd6d3

Browse files
committed
use wait function for bootloader_jump
1 parent 3a3b621 commit 45fd6d3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

platforms/chibios/bootloaders/sn32_dfu.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include <ch.h>
2020
#include <hal.h>
21+
#include "wait.h"
2122

2223
# define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0))
2324
extern uint32_t __ram0_end__;
@@ -27,10 +28,7 @@ extern uint32_t __ram0_end__;
2728
__attribute__((weak)) void bootloader_jump(void) {
2829
*MAGIC_ADDR = BOOTLOADER_MAGIC; // set magic flag => reset handler will jump into boot loader
2930
// Wait for memory to be set before the reset
30-
// FIXME: update to wait funcion
31-
for(volatile uint32_t i = 0; i < 32; i++){
32-
__NOP();
33-
}
31+
wait_us(1);
3432
NVIC_SystemReset();
3533
}
3634

0 commit comments

Comments
 (0)