Turn on DEBUGFLOW and software CRC computation
This commit is contained in:
parent
ac6f837e4a
commit
cb45883970
2 changed files with 8 additions and 8 deletions
|
@ -455,7 +455,7 @@ hal_frame_read(hal_rx_frame_t *rx_frame, rx_callback_t rx_callback)
|
||||||
|
|
||||||
/*Check for correct frame length.*/
|
/*Check for correct frame length.*/
|
||||||
if ((frame_length >= HAL_MIN_FRAME_LENGTH) && (frame_length <= HAL_MAX_FRAME_LENGTH)){
|
if ((frame_length >= HAL_MIN_FRAME_LENGTH) && (frame_length <= HAL_MAX_FRAME_LENGTH)){
|
||||||
uint16_t crc = 0;
|
// uint16_t crc = 0;
|
||||||
// if (rx_frame){
|
// if (rx_frame){
|
||||||
rx_data = (rx_frame->data);
|
rx_data = (rx_frame->data);
|
||||||
rx_frame->length = frame_length;
|
rx_frame->length = frame_length;
|
||||||
|
@ -475,8 +475,8 @@ hal_frame_read(hal_rx_frame_t *rx_frame, rx_callback_t rx_callback)
|
||||||
// } else {
|
// } else {
|
||||||
// rx_callback(tempData);
|
// rx_callback(tempData);
|
||||||
// }
|
// }
|
||||||
|
/* RF230 does crc in hardware, for speed we hope the buffer is not being overwritten! */
|
||||||
crc = _crc_ccitt_update(crc, tempData);
|
// crc = _crc_ccitt_update(crc, tempData);
|
||||||
|
|
||||||
while ((SPSR & (1 << SPIF)) == 0) {;}
|
while ((SPSR & (1 << SPIF)) == 0) {;}
|
||||||
|
|
||||||
|
@ -490,10 +490,10 @@ hal_frame_read(hal_rx_frame_t *rx_frame, rx_callback_t rx_callback)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
HAL_SS_HIGH();
|
HAL_SS_HIGH();
|
||||||
|
rx_frame->crc = 1;
|
||||||
/*Check calculated crc, and set crc field in hal_rx_frame_t accordingly.*/
|
/*Check calculated crc, and set crc field in hal_rx_frame_t accordingly.*/
|
||||||
// if (rx_frame){
|
// if (rx_frame){
|
||||||
rx_frame->crc = (crc == HAL_CALCULATED_CRC_OK);
|
// rx_frame->crc = (crc == HAL_CALCULATED_CRC_OK);
|
||||||
// } else {
|
// } else {
|
||||||
// rx_callback(crc != HAL_CALCULATED_CRC_OK);
|
// rx_callback(crc != HAL_CALCULATED_CRC_OK);
|
||||||
// }
|
// }
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* @(#)$Id: rf230bb.c,v 1.10 2010/06/14 19:19:17 adamdunkels Exp $
|
* @(#)$Id: rf230bb.c,v 1.11 2010/06/18 15:44:53 dak664 Exp $
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* This code is almost device independent and should be easy to port.
|
* This code is almost device independent and should be easy to port.
|
||||||
|
@ -139,7 +139,7 @@ uint16_t RF230_sendpackets,RF230_receivepackets,RF230_sendfail,RF230_receivefail
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Track flow through driver, see contiki-raven-main.c for example of use */
|
/* Track flow through driver, see contiki-raven-main.c for example of use */
|
||||||
#define DEBUGFLOWSIZE 64
|
//#define DEBUGFLOWSIZE 64
|
||||||
#if DEBUGFLOWSIZE
|
#if DEBUGFLOWSIZE
|
||||||
uint8_t debugflowsize,debugflow[DEBUGFLOWSIZE];
|
uint8_t debugflowsize,debugflow[DEBUGFLOWSIZE];
|
||||||
#define DEBUGFLOW(c) if (debugflowsize<(DEBUGFLOWSIZE-1)) debugflow[debugflowsize++]=c
|
#define DEBUGFLOW(c) if (debugflowsize<(DEBUGFLOWSIZE-1)) debugflow[debugflowsize++]=c
|
||||||
|
@ -1026,7 +1026,7 @@ rf230_read(void *buf, unsigned short bufsize)
|
||||||
|
|
||||||
len=rxframe.length;
|
len=rxframe.length;
|
||||||
if (len==0) {
|
if (len==0) {
|
||||||
#if RADIOALWAYSON
|
#if RADIOALWAYSON && DEBUGFLOWSIZE
|
||||||
if (RF230_receive_on==0) {if (debugflow[debugflowsize-1]!='z') DEBUGFLOW('z');} //cxmac calls with radio off?
|
if (RF230_receive_on==0) {if (debugflow[debugflowsize-1]!='z') DEBUGFLOW('z');} //cxmac calls with radio off?
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue