From: Keith Packard Date: Wed, 25 Mar 2009 05:37:38 +0000 (-0700) Subject: Wait for xtal to stabilize after changing to 24MHz X-Git-Tag: 0.5~58^2~42 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=8ecbd8734f0fb5588b2a8eb20720cfc6f43dfb47 Wait for xtal to stabilize after changing to 24MHz --- diff --git a/target/ee/ee.c b/target/ee/ee.c index 08d55137..7cc47120 100644 --- a/target/ee/ee.c +++ b/target/ee/ee.c @@ -26,6 +26,10 @@ sfr at 0x80 P0; sfr at 0x90 P1; sfr at 0xA0 P2; sfr at 0xC6 CLKCON; +sfr at 0xbe SLEEP; + +# define SLEEP_USB_EN (1 << 7) +# define SLEEP_XOSC_STB (1 << 6) sfr at 0xF1 PERCFG; #define PERCFG_T1CFG_ALT_1 (0 << 6) @@ -379,6 +383,8 @@ main () P1DIR |= 2; CLKCON = 0; + while (!(SLEEP & SLEEP_XOSC_STB)) + ; spi_init();