mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-05 04:10:58 +00:00
feat(legacy): grab 'go to bootloader flag' as soon as possible
This commit is contained in:
parent
1c38819bf9
commit
040d09397c
@ -112,6 +112,10 @@ static void bootloader_loop(void) {
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
// grab go to bootloader flag as soon as possible
|
||||
register uint32_t r11 __asm__("r11");
|
||||
volatile uint32_t go_to_bootloader_flag = r11;
|
||||
|
||||
#ifndef APPVER
|
||||
setup();
|
||||
#endif
|
||||
@ -124,8 +128,6 @@ int main(void) {
|
||||
|
||||
mpu_config_bootloader();
|
||||
|
||||
register uint32_t go_to_bootloader_flag __asm__("r11");
|
||||
|
||||
if (go_to_bootloader_flag == RETURN_TO_BOOTLOADER_FLAG) {
|
||||
goto bootloader_loop_start;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user