Skip to content

Commit

Permalink
Allow configuring cpu frequency through board_build.f_cpu.
Browse files Browse the repository at this point in the history
  • Loading branch information
mh-dm committed Jun 7, 2024
1 parent eb50ef2 commit 7650df6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions system/CMSIS/system/system_LPC17xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,15 +559,21 @@ void SystemInit (void)

LPC_SC->CCLKCFG = 0x00000002; /* Setup CPU Clock Divider */

if(isLPC1769()) {
#if F_CPU == 120000000 && MCU_LPC1769
LPC_SC->PLL0CFG = 0x0000000E; /* configure PLL0 */
LPC_SC->PLL0FEED = 0xAA;
LPC_SC->PLL0FEED = 0x55;
} else {
LPC_SC->PLL0CFG = 0x00010018; // 100MHz
#elif F_CPU == 100000000
LPC_SC->PLL0CFG = 0x00010018;
LPC_SC->PLL0FEED = 0xAA;
LPC_SC->PLL0FEED = 0x55;
}
#elif F_CPU == 96000000
LPC_SC->PLL0CFG = 0x0000000B;
LPC_SC->PLL0FEED = 0xAA;
LPC_SC->PLL0FEED = 0x55;
#else
#error "The configured cpu frequency is not supported"
#endif

LPC_SC->PLL0CON = 0x01; /* PLL0 Enable */
LPC_SC->PLL0FEED = 0xAA;
Expand Down

0 comments on commit 7650df6

Please sign in to comment.