提交 9cb1b7a2 编写于 作者: A ArdaFu

[bsp][tm4c129x] Replace SysClock with SystemCoreClock

上级 5293dddd
......@@ -25,8 +25,7 @@
#include "driverlib/rom_map.h"
#define SYS_CLOCK_DEFAULT 120000000
uint32_t SysClock;
uint32_t SystemCoreClock;
#define FAULT_NMI 2 // NMI fault
#define FAULT_HARD 3 // Hard fault
#define FAULT_MPU 4 // MPU fault
......@@ -81,12 +80,12 @@ int rt_hw_cpu_init(void)
// Set the clocking to run directly from the external crystal/oscillator.
// TODO: The SYSCTL_XTAL_ value must be changed to match the value of the
// crystal on your board.
SysClock = MAP_SysCtlClockFreqSet(
SystemCoreClock = MAP_SysCtlClockFreqSet(
(SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480),
SYS_CLOCK_DEFAULT);
MAP_SysTickDisable();
MAP_SysTickPeriodSet(SysClock/ RT_TICK_PER_SECOND - 1);
MAP_SysTickPeriodSet(SystemCoreClock/ RT_TICK_PER_SECOND - 1);
MAP_SysTickIntEnable();
MAP_SysTickEnable();
......
......@@ -22,8 +22,7 @@
#include <stdbool.h>
#include <stdint.h>
extern uint32_t SysClock;
extern uint32_t SystemCoreClock;
#ifdef __CC_ARM
extern int Image$$RW_IRAM$$ZI$$Limit;
#define HEAP_BEGIN ((void *)&Image$$RW_IRAM$$ZI$$Limit)
......
......@@ -92,7 +92,7 @@ static rt_err_t hw_configure(struct rt_serial_device *serial, struct serial_conf
}
// Initialize UART0 peripheral with given to corresponding parameter
MAP_UARTConfigSetExpClk(uart->hw_base, SysClock, cfg->baud_rate, config);
MAP_UARTConfigSetExpClk(uart->hw_base, SystemCoreClock, cfg->baud_rate, config);
MAP_UARTFIFOEnable(uart->hw_base);
// Enable the UART.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册