Enable a flag when packet SFD seen
This commit is contained in:
parent
6f72ff7af1
commit
acea0afb35
2 changed files with 9 additions and 2 deletions
|
@ -26,7 +26,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)$Id: cc2420-arch-sfd.c,v 1.1 2009/12/05 19:42:56 adamdunkels Exp $
|
* @(#)$Id: cc2420-arch-sfd.c,v 1.2 2010/01/19 13:11:01 adamdunkels Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
|
@ -35,6 +35,7 @@
|
||||||
#include "dev/spi.h"
|
#include "dev/spi.h"
|
||||||
#include "dev/cc2420.h"
|
#include "dev/cc2420.h"
|
||||||
|
|
||||||
|
uint8_t cc2420_arch_sfd_counter;
|
||||||
uint16_t cc2420_arch_sfd_start_time;
|
uint16_t cc2420_arch_sfd_start_time;
|
||||||
uint16_t cc2420_arch_sfd_end_time;
|
uint16_t cc2420_arch_sfd_end_time;
|
||||||
|
|
||||||
|
@ -48,8 +49,10 @@ cc24240_timerb1_interrupt(void)
|
||||||
/* always read TBIV to clear IFG */
|
/* always read TBIV to clear IFG */
|
||||||
tbiv = TBIV;
|
tbiv = TBIV;
|
||||||
if(SFD_IS_1) {
|
if(SFD_IS_1) {
|
||||||
|
cc2420_arch_sfd_counter++;
|
||||||
cc2420_arch_sfd_start_time = TBCCR1;
|
cc2420_arch_sfd_start_time = TBCCR1;
|
||||||
} else {
|
} else {
|
||||||
|
cc2420_arch_sfd_counter = 0;
|
||||||
cc2420_arch_sfd_end_time = TBCCR1;
|
cc2420_arch_sfd_end_time = TBCCR1;
|
||||||
}
|
}
|
||||||
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
|
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
|
||||||
|
|
|
@ -26,11 +26,15 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)$Id: cc2420-arch-sfd.h,v 1.1 2009/12/05 19:42:56 adamdunkels Exp $
|
* @(#)$Id: cc2420-arch-sfd.h,v 1.2 2010/01/19 13:11:01 adamdunkels Exp $
|
||||||
*/
|
*/
|
||||||
#ifndef CC2420_ARCH_SFD_H
|
#ifndef CC2420_ARCH_SFD_H
|
||||||
#define CC2420_ARCH_SFD_H
|
#define CC2420_ARCH_SFD_H
|
||||||
|
|
||||||
|
extern uint8_t cc2420_arch_sfd_counter;
|
||||||
|
extern uint16_t cc2420_arch_sfd_start_time;
|
||||||
|
extern uint16_t cc2420_arch_sfd_end_time;
|
||||||
|
|
||||||
void cc2420_arch_sfd_init(void);
|
void cc2420_arch_sfd_init(void);
|
||||||
|
|
||||||
#endif /* CC2420_ARCH_SFD_H */
|
#endif /* CC2420_ARCH_SFD_H */
|
||||||
|
|
Loading…
Reference in a new issue