From 01579c8ee0a90c0e9d34377f344c7a0885104fe7 Mon Sep 17 00:00:00 2001 From: travisutk Date: Thu, 23 Dec 2010 00:28:38 +0000 Subject: [PATCH] Support for fixed length packets, shell code now installs to client/. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@792 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- shellcode/chipcon/cc1110/Makefile | 3 +++ shellcode/chipcon/cc1110/crystal.c | 18 +++++++++++++----- shellcode/chipcon/cc1110/rxpacket.c | 26 +++++++++++++++++++------- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/shellcode/chipcon/cc1110/Makefile b/shellcode/chipcon/cc1110/Makefile index 12df0f3..1b17200 100644 --- a/shellcode/chipcon/cc1110/Makefile +++ b/shellcode/chipcon/cc1110/Makefile @@ -16,3 +16,6 @@ all: $(objs) $(CC) $< clean: rm -f *.ihx *.rel *.hex *.sym *.asm *.lst *.lnk *.map *.mem *.rst *.adb +install: all + cp $(objs) ../../../client/shellcode/chipcon/cc1110/ + #Shellcode installed. diff --git a/shellcode/chipcon/cc1110/crystal.c b/shellcode/chipcon/cc1110/crystal.c index 226cbfd..f32e755 100644 --- a/shellcode/chipcon/cc1110/crystal.c +++ b/shellcode/chipcon/cc1110/crystal.c @@ -3,11 +3,19 @@ //! Start the crystal oscillator at 26MHz. void main(){ - SLEEP &= ~SLEEP_OSC_PD; // Turn both high speed oscillators on - while( !(SLEEP & SLEEP_XOSC_S) ); // Wait until xtal oscillator is stable - CLKCON = (CLKCON & ~(CLKCON_CLKSPD | CLKCON_OSC)) | CLKSPD_DIV_1; // Select xtal osc, 26 MHz - while (CLKCON & CLKCON_OSC); // Wait for change to take effect - SLEEP |= SLEEP_OSC_PD; // Turn off the other high speed oscillator (the RC osc) + // Turn both high speed oscillators on + SLEEP &= ~SLEEP_OSC_PD; + // Wait until xtal oscillator is stable + while( !(SLEEP & SLEEP_XOSC_S) ); + + // Select xtal osc, 26 MHz + CLKCON = + (CLKCON & ~(CLKCON_CLKSPD | CLKCON_OSC)) + | CLKSPD_DIV_1; + // Wait for change to take effect + while (CLKCON & CLKCON_OSC); + // Turn off the RC osc. + SLEEP |= SLEEP_OSC_PD; HALT; } diff --git a/shellcode/chipcon/cc1110/rxpacket.c b/shellcode/chipcon/cc1110/rxpacket.c index 0535f0b..13ec690 100644 --- a/shellcode/chipcon/cc1110/rxpacket.c +++ b/shellcode/chipcon/cc1110/rxpacket.c @@ -24,13 +24,25 @@ void main(){ //Begin to receive. RFST=RFST_SRX; while(MARCSTATE!=MARC_STATE_RX); - - while(i