2 #include "cc1110-ext.h"
5 char __xdata at 0xfe00 packet[MAXLEN] ;
7 //! Receives a packet out of the radio from 0xFE00.
9 unsigned char len=16, i=0;
22 while(MARCSTATE!=MARC_STATE_IDLE);
26 while(MARCSTATE!=MARC_STATE_RX);
28 while(i<len+3){ //len+3 if status is appended.
29 while(!RFTXRXIF); //Wait for byte to be ready.
30 RFTXRXIF=0; //Clear the flag.
32 packet[i++]=RFD; //Grab the next byte.
33 len=packet[0]; //First byte of the packet is the length.
35 RFST = RFST_SIDLE; //End receive.
37 //This while loop can be used for filtering. Unused for now.
38 }while(0); //packet[0]==(char) 0x0f || packet[1]==(char) 0xFF || packet[9]==(char) 0x03);