瀏覽代碼

Move PIT timer init after CPU clock set

fixes #394
main
PaulStoffregen 5 年之前
父節點
當前提交
4d5c71b841
共有 1 個文件被更改,包括 8 次插入8 次删除
  1. +8
    -8
      teensy4/startup.c

+ 8
- 8
teensy4/startup.c 查看文件

@@ -83,14 +83,6 @@ void ResetHandler(void)
IOMUXC_GPR_GPR29 = 0xFFFFFFFF;
#endif

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

// must enable PRINT_DEBUG_STUFF in debug/print.h
printf_debug_init();
printf("\n***********IMXRT Startup**********\n");
@@ -106,6 +98,14 @@ void ResetHandler(void)

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

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

// initialize RTC
if (!(SNVS_LPCR & SNVS_LPCR_SRTC_ENV)) {
// if SRTC isn't running, start it with default Jan 1, 2019

Loading…
取消
儲存