1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 22:38:08 +00:00

firmware: init display when used in standalone (firmware0) mode

This commit is contained in:
Pavol Rusnak 2017-09-28 14:08:08 +02:00
parent 43e8b85700
commit cfe9c73c78
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
3 changed files with 16 additions and 0 deletions

View File

@ -21,12 +21,22 @@
#include "sdcard.h"
#include "touch.h"
bool firmware_standalone(void)
{
extern const uint32_t _flash_start;
return _flash_start == 0x0800000;
}
int main(void) {
periph_init();
pendsv_init();
if (firmware_standalone()) {
display_init();
}
display_pwm_init();
display_orientation(0);
display_backlight(255);

View File

@ -92,6 +92,9 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
}
_flash_start = ORIGIN(FLASH);
_flash_end = ORIGIN(FLASH) + LENGTH(FLASH);
/* RAM extents for the garbage collector */
_codelen = SIZEOF(.flash) + SIZEOF(.data);
_ram_start = ORIGIN(RAM);

View File

@ -85,6 +85,9 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
}
_flash_start = ORIGIN(FLASH);
_flash_end = ORIGIN(FLASH) + LENGTH(FLASH);
/* RAM extents for the garbage collector */
_codelen = SIZEOF(.flash) + SIZEOF(.data);
_ram_start = ORIGIN(RAM);