提交 05a01884 编写于 作者: G Grissiom

lpc43xx: fix clock configure

上级 11026d05
...@@ -46,7 +46,8 @@ void rt_hw_board_init() ...@@ -46,7 +46,8 @@ void rt_hw_board_init()
SystemCoreClockUpdate(); SystemCoreClockUpdate();
/* Setup RIT timer. */ /* Setup RIT timer. */
LPC_RITIMER->COMPVAL = SystemCoreClock / RT_TICK_PER_SECOND - 1; LPC_RITIMER->MASK = 0;
LPC_RITIMER->COMPVAL = SystemCoreClock / RT_TICK_PER_SECOND;
/* Enable auto-clear. */ /* Enable auto-clear. */
LPC_RITIMER->CTRL |= 1 << 1; LPC_RITIMER->CTRL |= 1 << 1;
/* Reset the counter as the counter is enabled after reset. */ /* Reset the counter as the counter is enabled after reset. */
...@@ -62,7 +63,5 @@ void rt_hw_board_init() ...@@ -62,7 +63,5 @@ void rt_hw_board_init()
/* setup the console device */ /* setup the console device */
rt_console_set_device(RT_CONSOLE_DEVICE_NAME); rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
rt_kprintf("timer compval: %d\n", LPC_RITIMER->COMPVAL);
} }
...@@ -55,7 +55,7 @@ void rt_hw_board_init() ...@@ -55,7 +55,7 @@ void rt_hw_board_init()
SystemCoreClockUpdate(); SystemCoreClockUpdate();
/* init systick */ /* init systick */
SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND - 1); SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);
/* set pend exception priority */ /* set pend exception priority */
NVIC_SetPriority(PendSV_IRQn, (1 << __NVIC_PRIO_BITS) - 1); NVIC_SetPriority(PendSV_IRQn, (1 << __NVIC_PRIO_BITS) - 1);
...@@ -65,7 +65,6 @@ void rt_hw_board_init() ...@@ -65,7 +65,6 @@ void rt_hw_board_init()
/* setup the console device */ /* setup the console device */
rt_console_set_device(RT_CONSOLE_DEVICE_NAME); rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
rt_kprintf("timer compval: %d\n", SystemCoreClock / RT_TICK_PER_SECOND - 1);
#if LPC_EXT_SDRAM == 1 #if LPC_EXT_SDRAM == 1
lpc_sdram_hw_init(); lpc_sdram_hw_init();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册