X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=shellcode%2Fchipcon%2Fcc1110%2Ftxpacket.c;h=87a37b740d133f89dd3885314c045b06651f07d2;hp=fa0ad986ac9c95b65601253bd3faaaea7e82066f;hb=8e9ea4afe6fe3dc788cef00258e35b124165e259;hpb=3c9dd526729e4296e7ac231840a445de182c8734 diff --git a/shellcode/chipcon/cc1110/txpacket.c b/shellcode/chipcon/cc1110/txpacket.c index fa0ad98..87a37b7 100644 --- a/shellcode/chipcon/cc1110/txpacket.c +++ b/shellcode/chipcon/cc1110/txpacket.c @@ -3,16 +3,39 @@ char __xdata at 0xfe00 packet[256] ; +void sleepMillis(int ms) { + int j; + while (--ms > 0) { + for (j=0; j<1200;j++); // about 1 millisecond + }; +} + //! Transmit a packet out of the radio from 0xFE00. void main(){ unsigned char len=packet[0], i=0; + long j; + + //Disable interrupts. + RFTXRXIE=0; + + //idle a bit. + RFST=RFST_SIDLE; + while(MARCSTATE!=MARC_STATE_IDLE); + + RFST=RFST_STX; //Begin transmit. - while(i!=len+1){ + while(MARCSTATE!=MARC_STATE_TX); + + while(i