X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=picinit.c;h=4274e2a43e9dc752554cc7e97479000f850fef8f;hb=8c7b4fef50432ef0775b00b3fe7737a1b924b1af;hp=40843b203b5f752faedb9b1a5dcfd4655036bcac;hpb=5c74e1a22c444b8769e0ce82975414f1c72b7b0e;p=rgblamp.git diff --git a/picinit.c b/picinit.c index 40843b2..4274e2a 100644 --- a/picinit.c +++ b/picinit.c @@ -7,23 +7,13 @@ #include -#define RUNAT32MHZ /* else 16 MHz */ - -#if defined(RUNAT32MHZ) __CONFIG(WDTE_OFF & FOSC_INTOSC); -__CONFIG(LVP_OFF & PLLEN_ON); -#else -__CONFIG(WDTE_OFF); __CONFIG(LVP_OFF); -#endif void pic_init() { -#if defined(RUNAT32MHZ) - OSCCON = 0b11110000; -#else /* 16 MHz */ - OSCCON = 0b01111010; -#endif + /* Setting below must match _XTAL_FREQ in picinit.h */ + OSCCON = 0b01101000; /* OSCSTAT.HFIOFL is set when oscillator is locked (accurate within 2%) */ while (!HFIOFL);