Browse Source

sam3x: Correct pmc_xtal_enable to use startup time parameter.

pull/141/merge
Gareth McMullin 12 years ago
committed by Piotr Esden-Tempski
parent
commit
c9cd2d9ab1
  1. 5
      lib/sam3x/pmc.c

5
lib/sam3x/pmc.c

@ -22,8 +22,9 @@
void pmc_xtal_enable(bool en, u8 startup_time)
{
if (en) {
CKGR_MOR |= CKGR_MOR_KEY |
CKGR_MOR_MOSCXTEN | CKGR_MOR_MOSCXTST_MASK;
CKGR_MOR = (CKGR_MOR & ~CKGR_MOR_MOSCXTST_MASK) |
CKGR_MOR_KEY | CKGR_MOR_MOSCXTEN |
(startup_time << 8);
while (!(PMC_SR & PMC_SR_MOSCXTS));
} else {
CKGR_MOR = CKGR_MOR_KEY | (CKGR_MOR & ~CKGR_MOR_MOSCXTEN);

Loading…
Cancel
Save