summaryrefslogtreecommitdiff
path: root/software/led_fade
diff options
context:
space:
mode:
Diffstat (limited to 'software/led_fade')
-rw-r--r--software/led_fade/led_fade.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/software/led_fade/led_fade.c b/software/led_fade/led_fade.c
index 3c7b8c8..9b50eda 100644
--- a/software/led_fade/led_fade.c
+++ b/software/led_fade/led_fade.c
@@ -68,11 +68,14 @@ static void _puts(const char * s) {
int main (void){
- // Run off 16 MHz Crystal for accuracy.
+ // Make sure the HFROSC is on before the next line:
+ PRCI_REG(PRCI_HFROSCCFG) |= ROSC_EN(1);
+ // Run off 16 MHz Crystal for accuracy. Note that the
+ // first line is
PRCI_REG(PRCI_PLLCFG) = (PLL_REFSEL(1) | PLL_BYPASS(1));
PRCI_REG(PRCI_PLLCFG) |= (PLL_SEL(1));
// Turn off HFROSC to save power
- PRCI_REG(PRCI_HFROSCCFG) = 0;
+ PRCI_REG(PRCI_HFROSCCFG) &= ~(ROSC_EN(1));
// Configure UART to print
GPIO_REG(GPIO_OUTPUT_VAL) |= IOF0_UART0_MASK;