Skip to content

Commit e8dcecb

Browse files
committed
Merge pull request #226 from star297/master
Update system_LPC8xx.c
2 parents 60d326e + 908a9b9 commit e8dcecb

File tree

1 file changed

+17
-7
lines changed
  • libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC81X/TARGET_LPC812

1 file changed

+17
-7
lines changed

libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC81X/TARGET_LPC812/system_LPC8xx.c

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,23 @@
100100
// </h>
101101
// </e>
102102
*/
103-
#define CLOCK_SETUP 1
104-
#define SYSOSCCTRL_Val 0x00000000 // Reset: 0x000
105-
#define WDTOSCCTRL_Val 0x00000000 // Reset: 0x000
106-
#define SYSPLLCTRL_Val 0x00000041 // Reset: 0x000
107-
#define SYSPLLCLKSEL_Val 0x00000000 // Reset: 0x000
108-
#define MAINCLKSEL_Val 0x00000000 // Reset: 0x000
109-
#define SYSAHBCLKDIV_Val 0x00000001 // Reset: 0x001
103+
#define CLOCK_SETUP 1 // 1 == IRC: 2 == System Oscillator 12Mhz Xtal:
104+
105+
#if (CLOCK_SETUP == 1)
106+
#define SYSOSCCTRL_Val 0x00000000 // Reset: 0x000
107+
#define WDTOSCCTRL_Val 0x00000000 // Reset: 0x000
108+
#define SYSPLLCTRL_Val 0x00000041 // Reset: 0x000
109+
#define SYSPLLCLKSEL_Val 0x00000000 // Reset: 0x000
110+
#define MAINCLKSEL_Val 0x00000000 // Reset: 0x000
111+
#define SYSAHBCLKDIV_Val 0x00000001 // Reset: 0x001
112+
#elif (CLOCK_SETUP == 2)
113+
#define SYSOSCCTRL_Val 0x00000000 // Reset: 0x000
114+
#define WDTOSCCTRL_Val 0x00000000 // Reset: 0x000
115+
#define SYSPLLCTRL_Val 0x00000040 // Reset: 0x000
116+
#define SYSPLLCLKSEL_Val 0x00000001 // Reset: 0x000
117+
#define MAINCLKSEL_Val 0x00000003 // Reset: 0x000
118+
#define SYSAHBCLKDIV_Val 0x00000001 // Reset: 0x001
119+
#endif
110120

111121
/*
112122
//-------- <<< end of configuration section >>> ------------------------------

0 commit comments

Comments
 (0)