From 09db1598765da35b6b8ec7479de4b4ac09270104 Mon Sep 17 00:00:00 2001 From: David Kopf Date: Thu, 18 Aug 2011 14:36:04 -0400 Subject: [PATCH] 128rfa1 cca fix, NETSTACK_RADIO.off now returns 0/1 if radio off/on --- cpu/avr/radio/rf230bb/hal.h | 6 ++-- cpu/avr/radio/rf230bb/halbb.c | 2 +- cpu/avr/radio/rf230bb/rf230bb.c | 60 +++++++++++++++++---------------- 3 files changed, 36 insertions(+), 32 deletions(-) diff --git a/cpu/avr/radio/rf230bb/hal.h b/cpu/avr/radio/rf230bb/hal.h index 4df4a5e5d..03a715434 100644 --- a/cpu/avr/radio/rf230bb/hal.h +++ b/cpu/avr/radio/rf230bb/hal.h @@ -345,7 +345,8 @@ #define hal_set_rst_high( ) ( TRXPR |= ( 1 << TRXRST ) ) /**< This macro pulls the RST pin high. */ #define hal_set_slptr_high( ) ( TRXPR |= ( 1 << SLPTR ) ) /**< This macro pulls the SLP_TR pin high. */ #define hal_set_slptr_low( ) ( TRXPR &= ~( 1 << SLPTR ) ) /**< This macro pulls the SLP_TR pin low. */ -#define hal_get_slptr( ) ( ( TRXPR & ( 1 << SLPTR ) ) >> SLPTR ) /**< Read current state of the SLP_TR pin (High/Low). */ +//#define hal_get_slptr( ) ( ( TRXPR & ( 1 << SLPTR ) ) >> SLPTR ) /**< Read current state of the SLP_TR pin (High/Low). */ +#define hal_get_slptr( ) ( TRXPR & ( 1 << SLPTR ) ) /**< Read current state of the SLP_TR pin (High/Low). */ #else #define SLP_TR SLPTRPIN /**< Pin number that corresponds to the SLP_TR pin. */ @@ -354,7 +355,8 @@ #define PIN_SLP_TR PIN( SLPTRPORT ) /**< Pin (Read Access) where SLP_TR is connected. */ #define hal_set_slptr_high( ) ( PORT_SLP_TR |= ( 1 << SLP_TR ) ) /**< This macro pulls the SLP_TR pin high. */ #define hal_set_slptr_low( ) ( PORT_SLP_TR &= ~( 1 << SLP_TR ) ) /**< This macro pulls the SLP_TR pin low. */ -#define hal_get_slptr( ) ( ( PIN_SLP_TR & ( 1 << SLP_TR ) ) >> SLP_TR ) /**< Read current state of the SLP_TR pin (High/Low). */ +//#define hal_get_slptr( ) ( ( PIN_SLP_TR & ( 1 << SLP_TR ) ) >> SLP_TR ) /**< Read current state of the SLP_TR pin (High/Low). */ +#define hal_get_slptr( ) ( PIN_SLP_TR & ( 1 << SLP_TR ) ) /**< Read current state of the SLP_TR pin (High/Low). */ #define RST RSTPIN /**< Pin number that corresponds to the RST pin. */ #define DDR_RST DDR( RSTPORT ) /**< Data Direction Register that corresponds to the port where RST is */ #define PORT_RST PORT( RSTPORT ) /**< Port (Write Access) where RST is connected. */ diff --git a/cpu/avr/radio/rf230bb/halbb.c b/cpu/avr/radio/rf230bb/halbb.c index 8f6dd6d04..67fe835fe 100644 --- a/cpu/avr/radio/rf230bb/halbb.c +++ b/cpu/avr/radio/rf230bb/halbb.c @@ -833,7 +833,7 @@ ISR(TRX24_RX_END_vect) /* Buffer the frame and call rf230_interrupt to schedule poll for rf230 receive process */ /* Is a ram buffer available? */ - if (rxframe[rxframe_tail].length) {DEBUGFLOW('0');} else DEBUGFLOW('1'); + if (rxframe[rxframe_tail].length) {DEBUGFLOW('0');} else /*DEBUGFLOW('1')*/; #ifdef RF230_MIN_RX_POWER /* Discard packets weaker than the minimum if defined. This is for testing miniature meshes */ diff --git a/cpu/avr/radio/rf230bb/rf230bb.c b/cpu/avr/radio/rf230bb/rf230bb.c index 9bac10add..3164b1099 100644 --- a/cpu/avr/radio/rf230bb/rf230bb.c +++ b/cpu/avr/radio/rf230bb/rf230bb.c @@ -502,10 +502,9 @@ on(void) #if defined(__AVR_ATmega128RFA1__) rf230_interruptwait=1; ENERGEST_ON(ENERGEST_TYPE_LED_RED); - PORTE|=(1<