Skip to content

Commit

Permalink
sam3x: Correct pmc_xtal_enable to use startup time parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmcmullin authored and esden committed May 10, 2013
1 parent 060839e commit c9cd2d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/sam3x/pmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c9cd2d9

Please sign in to comment.