2 #include "cc1110-ext.h"
4 char __xdata at 0xfe00 packet[256] ;
6 //! Transmit a packet out of the radio from 0xFE00.
8 unsigned char len=packet[0], i=0;
12 while(MARCSTATE!=MARC_STATE_IDLE);
14 RFST=RFST_STX; //Begin transmit.
16 while(!RFTXRXIF); //Wait for byte to be ready.
18 RFTXRXIF=0; //Clear the flag.
19 RFD=packet[i++]; //Send the next byte.
21 RFST = RFST_SIDLE; //End transmit.
24 while(MARCSTATE!=MARC_STATE_IDLE);
28 while(MARCSTATE!=MARC_STATE_RX);
31 while(!RFTXRXIF); //Wait for byte to be ready.
32 RFTXRXIF=0; //Clear the flag.
34 if (MARCSTATE == MARC_STATE_RX) {
35 packet[i]=RFD; //Grab the next byte.
37 len=packet[0]; //First byte of the packet is the length.
42 RFST = RFST_SIDLE; //End receive.