From 9cb1b7a252f71f29cfca0708f9877dead8d86185 Mon Sep 17 00:00:00 2001 From: ArdaFu Date: Mon, 6 Nov 2017 14:07:31 +0800 Subject: [PATCH] [bsp][tm4c129x] Replace SysClock with SystemCoreClock --- bsp/tm4c129x/applications/board.c | 7 +++---- bsp/tm4c129x/applications/board.h | 3 +-- bsp/tm4c129x/drivers/drv_uart.c | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bsp/tm4c129x/applications/board.c b/bsp/tm4c129x/applications/board.c index 6c64a8c14..0da547e86 100644 --- a/bsp/tm4c129x/applications/board.c +++ b/bsp/tm4c129x/applications/board.c @@ -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(); diff --git a/bsp/tm4c129x/applications/board.h b/bsp/tm4c129x/applications/board.h index 8c1b61417..8103d0b1f 100644 --- a/bsp/tm4c129x/applications/board.h +++ b/bsp/tm4c129x/applications/board.h @@ -22,8 +22,7 @@ #include #include -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) diff --git a/bsp/tm4c129x/drivers/drv_uart.c b/bsp/tm4c129x/drivers/drv_uart.c index 7b8153d4c..ef95144af 100644 --- a/bsp/tm4c129x/drivers/drv_uart.c +++ b/bsp/tm4c129x/drivers/drv_uart.c @@ -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.