From ca8fe618e7411148edebae394fe2d1c54bee5134 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Tue, 6 Oct 2015 16:12:24 +0200 Subject: [PATCH] cc2420 and cc2430: add comment on why we discard tbiv --- cpu/msp430/cc2420-arch-sfd.c | 1 + cpu/msp430/cc2520-arch-sfd.c | 1 + dev/cc2520/cc2520.c | 1 + 3 files changed, 3 insertions(+) diff --git a/cpu/msp430/cc2420-arch-sfd.c b/cpu/msp430/cc2420-arch-sfd.c index a940b8cab..6cd7d2606 100644 --- a/cpu/msp430/cc2420-arch-sfd.c +++ b/cpu/msp430/cc2420-arch-sfd.c @@ -45,6 +45,7 @@ ISR(TIMERB1, cc2420_timerb1_interrupt) ENERGEST_ON(ENERGEST_TYPE_IRQ); /* always read TBIV to clear IFG */ tbiv = TBIV; + /* read and discard tbiv to avoid "variable set but not used" warning */ (void)tbiv; if(CC2420_SFD_IS_1) { cc2420_sfd_counter++; diff --git a/cpu/msp430/cc2520-arch-sfd.c b/cpu/msp430/cc2520-arch-sfd.c index 852974b70..5e7bee813 100644 --- a/cpu/msp430/cc2520-arch-sfd.c +++ b/cpu/msp430/cc2520-arch-sfd.c @@ -44,6 +44,7 @@ ISR(TIMERB1, cc2520_timerb1_interrupt) ENERGEST_ON(ENERGEST_TYPE_IRQ); /* always read TBIV to clear IFG */ tbiv = TBIV; + /* read and discard tbiv to avoid "variable set but not used" warning */ (void)tbiv; if(CC2520_SFD_IS_1) { cc2520_sfd_counter++; diff --git a/dev/cc2520/cc2520.c b/dev/cc2520/cc2520.c index 3b40c8879..e0dad1b6a 100644 --- a/dev/cc2520/cc2520.c +++ b/dev/cc2520/cc2520.c @@ -217,6 +217,7 @@ flushrx(void) uint8_t dummy; CC2520_READ_FIFO_BYTE(dummy); + /* read and discard dummy to avoid "variable set but not used" warning */ (void)dummy; CC2520_STROBE(CC2520_INS_SFLUSHRX); CC2520_STROBE(CC2520_INS_SFLUSHRX);