mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-04 07:03:44 +08:00
659adb6457
date: 2024-03-17T10:14:38 master commit: 7e9a909e0e57ecb31df4c87c5b9a06b1204fd034
16 lines
502 B
C
16 lines
502 B
C
// Early bringup
|
|
extern void *g_pfnVectors;
|
|
extern uint32_t enter_bootloader_mode;
|
|
|
|
void early_initialization(void) {
|
|
SystemInit();
|
|
// after it's been in the bootloader, things are initted differently, so we reset
|
|
if ((enter_bootloader_mode != BOOT_NORMAL) &&
|
|
(enter_bootloader_mode != ENTER_SOFTLOADER_MAGIC)) {
|
|
enter_bootloader_mode = BOOT_NORMAL;
|
|
NVIC_SystemReset();
|
|
}
|
|
// setup interrupt table
|
|
SCB->VTOR = (uint32_t)&g_pfnVectors; // TODO: check if SystemInit is enough!
|
|
}
|