X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=shellcode%2Fchipcon%2Fcc1110%2Ftxpacket.c;h=87a37b740d133f89dd3885314c045b06651f07d2;hb=f89ac90c389c244a33e7b5dd20090bf588763291;hp=333e3d773a6c0b40d89e0f4cc0cc07d2f7405311;hpb=a06f45d24b010987c9128261ff33dd2c93db0970;p=goodfet diff --git a/shellcode/chipcon/cc1110/txpacket.c b/shellcode/chipcon/cc1110/txpacket.c index 333e3d7..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(RFTXRXIF); //Wait for byte to be ready. - + while(MARCSTATE!=MARC_STATE_TX); + + while(i