Shellcode is now only loaded when
[goodfet] / shellcode / chipcon / cc1110 / crystal.c
1 #include <cc1110.h>
2 #include "cc1110-ext.h"
3
4 //! Start the crystal oscillator at 26MHz.
5 void main(){
6   SLEEP &= ~SLEEP_OSC_PD; // Turn both high speed oscillators on
7   while( !(SLEEP & SLEEP_XOSC_S) ); // Wait until xtal oscillator is stable
8   CLKCON = (CLKCON & ~(CLKCON_CLKSPD | CLKCON_OSC)) | CLKSPD_DIV_1; // Select xtal osc, 26 MHz
9   while (CLKCON & CLKCON_OSC); // Wait for change to take effect
10   SLEEP |= SLEEP_OSC_PD; // Turn off the other high speed oscillator (the RC osc)
11   
12   HALT;
13 }