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;
21 while(MARCSTATE!=MARC_STATE_IDLE);
25 while(MARCSTATE!=MARC_STATE_RX);
27 while(i<len+1){ //len+3 if status is appended.
28 while(!RFTXRXIF); //Wait for byte to be ready.
29 RFTXRXIF=0; //Clear the flag.
31 if (MARCSTATE == MARC_STATE_RX) {
32 packet[i]=RFD; //Grab the next byte.
34 len=packet[0]; //First byte of the packet is the length.
39 RFST = RFST_SIDLE; //End receive.