Merge pull request #956 from ArdaFu/master

[bsp][tm4c129x] Replace SysClock with SystemCoreClock
This commit is contained in:
Bernard Xiong 2017-11-06 14:22:04 +08:00 committed by GitHub
commit b5496deee4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 7 deletions

View File

@ -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();

View File

@ -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)

View File

@ -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.