From a3c05bd19e09841d184c98a391da46dda7c90c5e Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 2 Apr 2019 16:40:09 +0800 Subject: [PATCH] sw: system: add reset key to reboot() Add the key `0xac` to the reset command, to prevent accidental resets. Signed-off-by: Sean Cross --- sw/include/system.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/include/system.h b/sw/include/system.h index d9bb543..b3b09bb 100644 --- a/sw/include/system.h +++ b/sw/include/system.h @@ -64,7 +64,7 @@ __attribute__((noreturn)) static inline void reboot(void) { } __attribute__((noreturn)) static inline void reboot_to_image(uint8_t image_index) { - reboot_ctrl_write(0xac | image_index); + reboot_ctrl_write(0xac | (image_index & 3) << 0); while (1); } #endif /* __SYSTEM_H */