File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -559,15 +559,17 @@ void SystemInit (void)
559559
560560 LPC_SC -> CCLKCFG = 0x00000002 ; /* Setup CPU Clock Divider */
561561
562- if (isLPC1769 ()) {
563- LPC_SC -> PLL0CFG = 0x0000000E ; /* configure PLL0 */
564- LPC_SC -> PLL0FEED = 0xAA ;
565- LPC_SC -> PLL0FEED = 0x55 ;
566- } else {
567- LPC_SC -> PLL0CFG = 0x00010018 ; // 100MHz
568- LPC_SC -> PLL0FEED = 0xAA ;
569- LPC_SC -> PLL0FEED = 0x55 ;
570- }
562+ #if F_CPU == 120000000 && MCU_LPC1769
563+ LPC_SC -> PLL0CFG = 0x0000000E ; /* configure PLL0 */
564+ #elif F_CPU == 100000000
565+ LPC_SC -> PLL0CFG = 0x00010018 ;
566+ #elif F_CPU == 96000000
567+ LPC_SC -> PLL0CFG = 0x0000000B ;
568+ #else
569+ #error "The configured cpu frequency is not supported"
570+ #endif
571+ LPC_SC -> PLL0FEED = 0xAA ;
572+ LPC_SC -> PLL0FEED = 0x55 ;
571573
572574 LPC_SC -> PLL0CON = 0x01 ; /* PLL0 Enable */
573575 LPC_SC -> PLL0FEED = 0xAA ;
You can’t perform that action at this time.
0 commit comments