Skip to content

Commit 3056ba7

Browse files
committed
mbed_die: Use wait_us not wait_ms
mbed_die was calling wait_ms in a critical section - this is deprecated behaviour, and caused a fatal error in debug builds, potentially leading to an infinite reboot loop if this was caused due to a reboot limit halt. Switch to using wait_us - this is safe in a critical section. This does trigger a call to mbed_warning, due to the large parameter, but that is harmless - it doesn't output anything to the console, and won't overwrite the error context if it already contains something.
1 parent a4ed473 commit 3056ba7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

platform/mbed_board.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ WEAK MBED_NORETURN void mbed_die(void)
3333
while (1) {
3434
for (int i = 0; i < 4; ++i) {
3535
gpio_write(&led_err, 1);
36-
wait_ms(150);
36+
wait_us(150000);
3737
gpio_write(&led_err, 0);
38-
wait_ms(150);
38+
wait_us(150000);
3939
}
4040

4141
for (int i = 0; i < 4; ++i) {
4242
gpio_write(&led_err, 1);
43-
wait_ms(400);
43+
wait_us(400000);
4444
gpio_write(&led_err, 0);
45-
wait_ms(400);
45+
wait_us(400000);
4646
}
4747
}
4848
}

0 commit comments

Comments
 (0)