From 9a1ce7cf7515db03717a6cdb24e5489a7430ed02 Mon Sep 17 00:00:00 2001 From: David Kopf Date: Wed, 31 Aug 2011 11:40:23 -0400 Subject: [PATCH] Use enumerated tx return values --- cpu/avr/radio/rf230bb/rf230bb.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cpu/avr/radio/rf230bb/rf230bb.c b/cpu/avr/radio/rf230bb/rf230bb.c index 9889b4629..9af14387e 100644 --- a/cpu/avr/radio/rf230bb/rf230bb.c +++ b/cpu/avr/radio/rf230bb/rf230bb.c @@ -980,16 +980,18 @@ rf230_transmit(unsigned short payload_len) RELEASE_LOCK(); if (tx_result==1) { //success, data pending from adressee - tx_result=0; //Just show success? + tx_result = RADIO_TX_OK; //Just show success? } else if (tx_result==3) { //CSMA channel access failure DEBUGFLOW('m'); RIMESTATS_ADD(contentiondrop); PRINTF("rf230_transmit: Transmission never started\n"); +....tx_result = RADIO_TX_COLLISION; } else if (tx_result==5) { //Expected ACK, none received DEBUGFLOW('n'); -// tx_result=0; +....tx_result = RADIO_TX_NOACK; } else if (tx_result==7) { //Invalid (Can't happen since waited for idle above?) DEBUGFLOW('o'); +....tx_result = RADIO_TX_ERR; } return tx_result; @@ -1694,4 +1696,4 @@ void rf230_start_sneeze(void) { // while (hal_register_read(0x0f)!=1) {continue;} //wait for pll lock-hangs hal_register_write(0x02,0x02); //Set TRX_STATE to TX_START } -#endif \ No newline at end of file +#endif