mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-29 01:28:10 +00:00
49 lines
971 B
C
49 lines
971 B
C
#include <unistd.h>
|
|
|
|
#include "common.h"
|
|
#include "display.h"
|
|
#include "emulator.h"
|
|
#include "flash.h"
|
|
#include "rust_ui.h"
|
|
|
|
uint8_t *FIRMWARE_START = 0;
|
|
uint32_t stay_in_bootloader_flag;
|
|
|
|
void set_core_clock(int) {}
|
|
|
|
int bootloader_main(void);
|
|
|
|
int main(int argc, char **argv) {
|
|
flash_init();
|
|
FIRMWARE_START =
|
|
(uint8_t *)flash_get_address(FLASH_SECTOR_FIRMWARE_START, 0, 0);
|
|
|
|
if (argc > 1 && argv[1][0] == 's') {
|
|
// Run the firmware
|
|
stay_in_bootloader_flag = STAY_IN_BOOTLOADER_FLAG;
|
|
}
|
|
|
|
int retval = bootloader_main();
|
|
hal_delay(3000);
|
|
exit(retval);
|
|
}
|
|
|
|
void display_set_little_endian(void) {}
|
|
|
|
void display_reinit(void) {}
|
|
|
|
void mpu_config_bootloader(void) {}
|
|
|
|
void mpu_config_off(void) {}
|
|
|
|
void jump_to(void *addr) {
|
|
screen_fatal_error_rust("= bootloader =", "Jumped to firmware", "this is ok");
|
|
display_refresh();
|
|
hal_delay(3000);
|
|
exit(0);
|
|
}
|
|
|
|
void ensure_compatible_settings(void) {}
|
|
|
|
void main_clean_exit(int code) { exit(code); }
|