X-Git-Url: http://git.rot13.org//?a=blobdiff_plain;f=shellcode%2Fchipcon%2Fcc1110%2Frxpacket.c;fp=shellcode%2Fchipcon%2Fcc1110%2Frxpacket.c;h=9bea2421a88107533052d28487d0a5761c593c93;hb=a06f45d24b010987c9128261ff33dd2c93db0970;hp=0000000000000000000000000000000000000000;hpb=b9e8a6ef91caf381fbc81606a3c442b77974ed62;p=goodfet diff --git a/shellcode/chipcon/cc1110/rxpacket.c b/shellcode/chipcon/cc1110/rxpacket.c new file mode 100644 index 0000000..9bea242 --- /dev/null +++ b/shellcode/chipcon/cc1110/rxpacket.c @@ -0,0 +1,20 @@ +#include +#include "cc1110-ext.h" + +char __xdata at 0xfe00 packet[256] ; + + +//! Receives a packet out of the radio from 0xFE00. +void main(){ + unsigned char len=100, i=0; + RFST=RFST_SRX; //Begin to receive. + while(i!=len+1){ + while(RFTXRXIF); //Wait for byte to be ready. + + RFTXRXIF=0; //Clear the flag. + packet[i++]=RFD; //Grab the next byte. + len=packet[0]; //First byte of the packet is the length. + } + RFST = RFST_SIDLE; //End transmit. + HALT; +}