projects
/
goodfet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Shellcode is now only loaded when
[goodfet]
/
shellcode
/
chipcon
/
cc1110
/
rxpacket.c
diff --git
a/shellcode/chipcon/cc1110/rxpacket.c
b/shellcode/chipcon/cc1110/rxpacket.c
index
eb722d1
..
5ba32a5
100644
(file)
--- a/
shellcode/chipcon/cc1110/rxpacket.c
+++ b/
shellcode/chipcon/cc1110/rxpacket.c
@@
-1,7
+1,8
@@
#include <cc1110.h>
#include "cc1110-ext.h"
#include <cc1110.h>
#include "cc1110-ext.h"
-char __xdata at 0xfe00 packet[256] ;
+#define MAXLEN 0xFF
+char __xdata at 0xfe00 packet[MAXLEN] ;
//! Receives a packet out of the radio from 0xFE00.
void main(){
//! Receives a packet out of the radio from 0xFE00.
void main(){
@@
-16,27
+17,22
@@
void main(){
RFTXRXIE=0;
//idle a bit.
RFTXRXIE=0;
//idle a bit.
- RFST=RFST_SIDLE;
- while(MARCSTATE!=MARC_STATE_IDLE);
+
//
RFST=RFST_SIDLE;
+
//
while(MARCSTATE!=MARC_STATE_IDLE);
//Begin to receive.
RFST=RFST_SRX;
while(MARCSTATE!=MARC_STATE_RX);
//Begin to receive.
RFST=RFST_SRX;
while(MARCSTATE!=MARC_STATE_RX);
- while(i
!=len+1){
+ while(i
<len+1){ //len+3 if status is appended.
while(!RFTXRXIF); //Wait for byte to be ready.
RFTXRXIF=0; //Clear the flag.
while(!RFTXRXIF); //Wait for byte to be ready.
RFTXRXIF=0; //Clear the flag.
- if (MARCSTATE == MARC_STATE_RX) {
- packet[i]=RFD; //Grab the next byte.
- //packet[i]=MARCSTATE;
- //if(packet[i]!=0)
- i++;
- //len=packet[0]; //First byte of the packet is the length.
- }else
- HALT;
-
+ packet[i]=RFD; //Grab the next byte.
+ i++;
+ len=packet[0]; //First byte of the packet is the length.
}
}
- RFST = RFST_SIDLE; //End
transmit
.
+ RFST = RFST_SIDLE; //End
receive
.
HALT;
}
HALT;
}
+