Code for receiving packets.
[goodfet] / shellcode / chipcon / cc1110 / txpacket.c
1 #include <cc1110.h>
2 #include "cc1110-ext.h"
3
4 char __xdata at 0xfe00 packet[256] ;
5
6 //! Transmit a packet out of the radio from 0xFE00.
7 void main(){
8   unsigned char len=packet[0], i=0;
9   RFST=RFST_STX;     //Begin transmit.
10   while(i!=len+1){
11     while(!RFTXRXIF); //Wait for byte to be ready.
12     
13     RFTXRXIF=0;      //Clear the flag.
14     RFD=packet[i++]; //Send the next byte.
15   }
16   RFST = RFST_SIDLE; //End transmit.
17   HALT;
18 }