Browse Source

Don't use naked attribute on startup code

main
PaulStoffregen 4 years ago
parent
commit
a2246a5a02
1 changed files with 1 additions and 3 deletions
  1. +1
    -3
      teensy4/startup.c

+ 1
- 3
teensy4/startup.c View File

void startup_early_hook(void) __attribute__ ((weak, alias("startup_default_early_hook"))); void startup_early_hook(void) __attribute__ ((weak, alias("startup_default_early_hook")));
void startup_default_late_hook(void) {} void startup_default_late_hook(void) {}
void startup_late_hook(void) __attribute__ ((weak, alias("startup_default_late_hook"))); void startup_late_hook(void) __attribute__ ((weak, alias("startup_default_late_hook")));
__attribute__((section(".startup"), optimize("no-tree-loop-distribute-patterns"), naked))
__attribute__((section(".startup"), optimize("no-tree-loop-distribute-patterns")))
void ResetHandler(void) void ResetHandler(void)
{ {
unsigned int i; unsigned int i;
set_arm_clock(F_CPU); set_arm_clock(F_CPU);
#endif #endif


asm volatile("nop\n nop\n nop\n nop": : :"memory"); // why oh why?

// Undo PIT timer usage by ROM startup // Undo PIT timer usage by ROM startup
CCM_CCGR1 |= CCM_CCGR1_PIT(CCM_CCGR_ON); CCM_CCGR1 |= CCM_CCGR1_PIT(CCM_CCGR_ON);
PIT_MCR = 0; PIT_MCR = 0;

Loading…
Cancel
Save