added active flags because some sensors react on radio activity
This commit is contained in:
parent
755ee04e24
commit
30822b5703
|
@ -28,7 +28,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* @(#)$Id: tr1001-gcr.c,v 1.3 2006/10/09 11:56:13 adamdunkels Exp $
|
* @(#)$Id: tr1001-gcr.c,v 1.4 2006/10/09 21:05:37 nifi Exp $
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* \addtogroup esb
|
* \addtogroup esb
|
||||||
|
@ -94,6 +94,8 @@ static unsigned short tr1001_rxlen = 0;
|
||||||
*/
|
*/
|
||||||
volatile unsigned char tr1001_rxstate = RXSTATE_READY;
|
volatile unsigned char tr1001_rxstate = RXSTATE_READY;
|
||||||
|
|
||||||
|
static u8_t radio_active;
|
||||||
|
|
||||||
static u16_t rxcrc, rxcrctmp;
|
static u16_t rxcrc, rxcrctmp;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -612,6 +614,8 @@ tr1001_send(u8_t *packet, u16_t len)
|
||||||
/* Prepare the transmission. */
|
/* Prepare the transmission. */
|
||||||
prepare_transmission(NUM_SYNCHBYTES);
|
prepare_transmission(NUM_SYNCHBYTES);
|
||||||
|
|
||||||
|
radio_active = 1;
|
||||||
|
|
||||||
crc16 = 0xffff;
|
crc16 = 0xffff;
|
||||||
|
|
||||||
gcr_init();
|
gcr_init();
|
||||||
|
@ -764,5 +768,17 @@ tr1001_sstrength_value(unsigned int type)
|
||||||
}
|
}
|
||||||
#endif /* TR1001_STATISTICS */
|
#endif /* TR1001_STATISTICS */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
unsigned char
|
||||||
|
tr1001_active(void)
|
||||||
|
{
|
||||||
|
return radio_active;
|
||||||
|
}
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
void
|
||||||
|
tr1001_clear_active(void)
|
||||||
|
{
|
||||||
|
radio_active = 0;
|
||||||
|
}
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
/** @} */
|
/** @} */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* @(#)$Id: tr1001.h,v 1.2 2006/10/09 11:56:13 adamdunkels Exp $
|
* @(#)$Id: tr1001.h,v 1.3 2006/10/09 21:05:37 nifi Exp $
|
||||||
*/
|
*/
|
||||||
#ifndef __TR1001_H__
|
#ifndef __TR1001_H__
|
||||||
#define __TR1001_H__
|
#define __TR1001_H__
|
||||||
|
@ -149,6 +149,8 @@ unsigned short tr1001_packets_ok(void);
|
||||||
unsigned short tr1001_packets_dropped(void);
|
unsigned short tr1001_packets_dropped(void);
|
||||||
void tr1001_clear_packets(void);
|
void tr1001_clear_packets(void);
|
||||||
unsigned short tr1001_sstrength_value(unsigned int type);
|
unsigned short tr1001_sstrength_value(unsigned int type);
|
||||||
|
unsigned char tr1001_active(void);
|
||||||
|
void tr1001_clear_active(void);
|
||||||
#endif /* TR1001_STATISTICS */
|
#endif /* TR1001_STATISTICS */
|
||||||
|
|
||||||
#endif /* __TR1001_H__ */
|
#endif /* __TR1001_H__ */
|
||||||
|
|
Loading…
Reference in a new issue