projects
/
goodfet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Working Simpliciti implementation.
[goodfet]
/
shellcode
/
chipcon
/
cc1110
/
txpacket.c
diff --git
a/shellcode/chipcon/cc1110/txpacket.c
b/shellcode/chipcon/cc1110/txpacket.c
index
e41ce49
..
87a37b7
100644
(file)
--- a/
shellcode/chipcon/cc1110/txpacket.c
+++ b/
shellcode/chipcon/cc1110/txpacket.c
@@
-3,9
+3,17
@@
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;
//Disable interrupts.
RFTXRXIE=0;
@@
-18,12
+26,16
@@
void main(){
RFST=RFST_STX; //Begin transmit.
while(MARCSTATE!=MARC_STATE_TX);
RFST=RFST_STX; //Begin transmit.
while(MARCSTATE!=MARC_STATE_TX);
- while(i
!=
len+1){
+ 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;
}