From 908a9b97a40a386462a71b8ac5761e90e9ecdea8 Mon Sep 17 00:00:00 2001 From: star297 Date: Sat, 22 Mar 2014 16:52:14 +0000 Subject: [PATCH] Update system_LPC8xx.c Add external 12Mhz crystal support as clock set up 2 --- .../TARGET_LPC812/system_LPC8xx.c | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC81X/TARGET_LPC812/system_LPC8xx.c b/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC81X/TARGET_LPC812/system_LPC8xx.c index 592cd5a750..2d1a94535a 100644 --- a/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC81X/TARGET_LPC812/system_LPC8xx.c +++ b/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC81X/TARGET_LPC812/system_LPC8xx.c @@ -100,13 +100,23 @@ // // */ -#define CLOCK_SETUP 1 -#define SYSOSCCTRL_Val 0x00000000 // Reset: 0x000 -#define WDTOSCCTRL_Val 0x00000000 // Reset: 0x000 -#define SYSPLLCTRL_Val 0x00000041 // Reset: 0x000 -#define SYSPLLCLKSEL_Val 0x00000000 // Reset: 0x000 -#define MAINCLKSEL_Val 0x00000000 // Reset: 0x000 -#define SYSAHBCLKDIV_Val 0x00000001 // Reset: 0x001 +#define CLOCK_SETUP 1 // 1 == IRC: 2 == System Oscillator 12Mhz Xtal: + +#if (CLOCK_SETUP == 1) + #define SYSOSCCTRL_Val 0x00000000 // Reset: 0x000 + #define WDTOSCCTRL_Val 0x00000000 // Reset: 0x000 + #define SYSPLLCTRL_Val 0x00000041 // Reset: 0x000 + #define SYSPLLCLKSEL_Val 0x00000000 // Reset: 0x000 + #define MAINCLKSEL_Val 0x00000000 // Reset: 0x000 + #define SYSAHBCLKDIV_Val 0x00000001 // Reset: 0x001 +#elif (CLOCK_SETUP == 2) + #define SYSOSCCTRL_Val 0x00000000 // Reset: 0x000 + #define WDTOSCCTRL_Val 0x00000000 // Reset: 0x000 + #define SYSPLLCTRL_Val 0x00000040 // Reset: 0x000 + #define SYSPLLCLKSEL_Val 0x00000001 // Reset: 0x000 + #define MAINCLKSEL_Val 0x00000003 // Reset: 0x000 + #define SYSAHBCLKDIV_Val 0x00000001 // Reset: 0x001 +#endif /* //-------- <<< end of configuration section >>> ------------------------------