stm32/mboot: Make 0x70ad0000 values named constants with macros.
Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
9246099935
commit
e64947dc90
2 changed files with 6 additions and 2 deletions
|
|
@ -1357,7 +1357,7 @@ void stm32_main(uint32_t initial_r0) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((initial_r0 & 0xffffff00) == 0x70ad0000) {
|
if ((initial_r0 & 0xffffff00) == MBOOT_INITIAL_R0_KEY) {
|
||||||
goto enter_bootloader;
|
goto enter_bootloader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1401,7 +1401,7 @@ enter_bootloader:
|
||||||
mboot_pack_init();
|
mboot_pack_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((initial_r0 & 0xffffff80) == 0x70ad0080) {
|
if ((initial_r0 & 0xffffff80) == MBOOT_INITIAL_R0_KEY_FSLOAD) {
|
||||||
mboot_state_change(MBOOT_STATE_FSLOAD_START, 0);
|
mboot_state_change(MBOOT_STATE_FSLOAD_START, 0);
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
#if MBOOT_FSLOAD
|
#if MBOOT_FSLOAD
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,10 @@
|
||||||
#define MBOOT_ADDRESS_SPACE_64BIT (0)
|
#define MBOOT_ADDRESS_SPACE_64BIT (0)
|
||||||
#endif
|
#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.
|
// These are for led_state_all() and can be or'd together.
|
||||||
#define MBOOT_LED_STATE_LED0 (0x01)
|
#define MBOOT_LED_STATE_LED0 (0x01)
|
||||||
#define MBOOT_LED_STATE_LED1 (0x02)
|
#define MBOOT_LED_STATE_LED1 (0x02)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue