diff options
author | Palmer Dabbelt <palmer@dabbelt.com> | 2017-06-13 23:48:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-13 23:48:08 -0700 |
commit | 2ea00ec38f26bea2840d91c0ef5627cb40baeee1 (patch) | |
tree | 386f872828b57ab27240a5d767c487533b2d780e | |
parent | decb0968a3f12ae29def0b391f5386f26f4ba280 (diff) | |
parent | e8938ea7fa90cea0f17460ef35ee00cdcb81aea3 (diff) |
Merge pull request #65 from sifive/led_fade_debug
Allow led_fade debug
-rw-r--r-- | software/led_fade/led_fade.c | 7 |
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; |