stm32/mboot: Make 0x70ad0000 values named constants with macros.

Signed-off-by: Damien George <damien@micropython.org>
pull/8714/head
Damien George 2022-06-01 20:57:44 +10:00
rodzic 9246099935
commit e64947dc90
2 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -1357,7 +1357,7 @@ void stm32_main(uint32_t initial_r0) {
}
#endif
if ((initial_r0 & 0xffffff00) == 0x70ad0000) {
if ((initial_r0 & 0xffffff00) == MBOOT_INITIAL_R0_KEY) {
goto enter_bootloader;
}
@ -1401,7 +1401,7 @@ enter_bootloader:
mboot_pack_init();
#endif
if ((initial_r0 & 0xffffff80) == 0x70ad0080) {
if ((initial_r0 & 0xffffff80) == MBOOT_INITIAL_R0_KEY_FSLOAD) {
mboot_state_change(MBOOT_STATE_FSLOAD_START, 0);
int ret = -1;
#if MBOOT_FSLOAD

Wyświetl plik

@ -46,6 +46,10 @@
#define MBOOT_ADDRESS_SPACE_64BIT (0)
#endif
// These values are used in initial_r0 to enter mboot programatically.
#define MBOOT_INITIAL_R0_KEY (0x70ad0000)
#define MBOOT_INITIAL_R0_KEY_FSLOAD (MBOOT_INITIAL_R0_KEY | 0x80)
// These are for led_state_all() and can be or'd together.
#define MBOOT_LED_STATE_LED0 (0x01)
#define MBOOT_LED_STATE_LED1 (0x02)