|
|
|
|
|
|
|
|
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; |