Shellcode is now only loaded when
[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   
10   //Disable interrupts.
11   RFTXRXIE=0;
12   
13   //idle a bit.
14   RFST=RFST_SIDLE;
15   while(MARCSTATE!=MARC_STATE_IDLE);
16   
17   
18   RFST=RFST_STX;     //Begin transmit.
19   while(MARCSTATE!=MARC_STATE_TX);
20   
21   while(i!=len+1){
22     while(!RFTXRXIF); //Wait for byte to be ready.
23     
24     RFTXRXIF=0;      //Clear the flag.
25     RFD=packet[i++]; //Send the next byte.
26   }
27   RFST = RFST_SIDLE; //End transmit.
28   HALT;
29 }