瀏覽代碼

Fix 24 MHz speed on Teensy 4.0

main
PaulStoffregen 5 年之前
父節點
當前提交
49b46c2087
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. +3
    -2
      teensy4/clockspeed.c

+ 3
- 2
teensy4/clockspeed.c 查看文件

@@ -153,8 +153,9 @@ uint32_t set_arm_clock(uint32_t frequency)
CCM_CBCDR = cbcdr;
}

cbcdr &= ~CCM_CBCDR_PERIPH_CLK_SEL;
CCM_CBCDR = cbcdr;
//cbcdr &= ~CCM_CBCDR_PERIPH_CLK_SEL;
//CCM_CBCDR = cbcdr; // why does this not work at 24 MHz?
CCM_CBCDR &= ~CCM_CBCDR_PERIPH_CLK_SEL;
while (CCM_CDHIPR & CCM_CDHIPR_PERIPH_CLK_SEL_BUSY) ; // wait

F_CPU_ACTUAL = frequency;

Loading…
取消
儲存