projects
/
goodfet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed the delay for now. Works with it, however.
[goodfet]
/
shellcode
/
chipcon
/
cc1110
/
txpacket.c
diff --git
a/shellcode/chipcon/cc1110/txpacket.c
b/shellcode/chipcon/cc1110/txpacket.c
index
fa0ad98
..
87a37b7
100644
(file)
--- a/
shellcode/chipcon/cc1110/txpacket.c
+++ b/
shellcode/chipcon/cc1110/txpacket.c
@@
-3,16
+3,39
@@
char __xdata at 0xfe00 packet[256] ;
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;
//! 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.
RFST=RFST_STX; //Begin transmit.
- while(i!=len+1){
+ while(MARCSTATE!=MARC_STATE_TX);
+
+ while(i<len+1){
while(!RFTXRXIF); //Wait for byte to be ready.
while(!RFTXRXIF); //Wait for byte to be ready.
-
+ while(MARCSTATE!=MARC_STATE_TX); //Lockup if needed.
RFTXRXIF=0; //Clear the flag.
RFD=packet[i++]; //Send the next byte.
}
RFTXRXIF=0; //Clear the flag.
RFD=packet[i++]; //Send the next byte.
}
- RFST = RFST_SIDLE; //End transmit.
+
+ //Wait for transmission to complete.
+ while(MARCSTATE==MARC_STATE_TX);
+
+ //RFST = RFST_SIDLE; //End transmit.
HALT;
}
HALT;
}