mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-13 19:18:56 +00:00
code cleanup 2: explicit .bss, linker map, and simpler systick
This commit is contained in:
parent
5b634098d9
commit
a1c33e32f0
@ -104,7 +104,7 @@ env.Replace(
|
||||
'-fstack-protector-all -ffreestanding '
|
||||
+ CCFLAGS_MOD,
|
||||
CCFLAGS_QSTR='-DNO_QSTR -DN_X64 -DN_X86 -DN_THUMB',
|
||||
LINKFLAGS='-nostdlib -T embed/boardloader/memory.ld --gc-sections',
|
||||
LINKFLAGS='-nostdlib -T embed/boardloader/memory.ld --gc-sections -Map=build/boardloader/boardloader.map',
|
||||
CPPPATH=[
|
||||
'embed/boardloader',
|
||||
'embed/trezorhal',
|
||||
|
@ -30,7 +30,7 @@ void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg,
|
||||
for (;;);
|
||||
}
|
||||
|
||||
uint32_t __stack_chk_guard;
|
||||
uint32_t __stack_chk_guard = 0;
|
||||
|
||||
void __attribute__((noreturn)) __stack_chk_fail(void)
|
||||
{
|
||||
|
@ -41,13 +41,9 @@ void SystemInit(void)
|
||||
SCB->CPACR |= ((3U << 22) | (3U << 20));
|
||||
}
|
||||
|
||||
volatile uint32_t uwTick = 0;
|
||||
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
extern volatile uint32_t uwTick;
|
||||
uwTick += 1;
|
||||
// TODO: verify the following claim, or remove
|
||||
// Read the systick control regster. This has the side effect of clearing
|
||||
// the COUNTFLAG bit, which makes the logic in sys_tick_get_microseconds
|
||||
// work properly.
|
||||
SysTick->CTRL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user