Fix code style

This commit is contained in:
George Oikonomou 2016-07-16 17:07:05 +01:00
parent 0313f9abf1
commit 833dc89f7c

View File

@ -185,8 +185,8 @@ get_channel()
{ {
uint8_t chan = REG(RFCORE_XREG_FREQCTRL) & RFCORE_XREG_FREQCTRL_FREQ; uint8_t chan = REG(RFCORE_XREG_FREQCTRL) & RFCORE_XREG_FREQCTRL_FREQ;
return ((chan - CC2538_RF_CHANNEL_MIN) / CC2538_RF_CHANNEL_SPACING return (chan - CC2538_RF_CHANNEL_MIN) / CC2538_RF_CHANNEL_SPACING
+ CC2538_RF_CHANNEL_MIN); + CC2538_RF_CHANNEL_MIN;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /**
@ -213,8 +213,9 @@ set_channel(uint8_t channel)
was_on = 1; was_on = 1;
off(); off();
} }
REG(RFCORE_XREG_FREQCTRL) = (CC2538_RF_CHANNEL_MIN REG(RFCORE_XREG_FREQCTRL) = (CC2538_RF_CHANNEL_MIN +
+ (channel - CC2538_RF_CHANNEL_MIN) * CC2538_RF_CHANNEL_SPACING); (channel - CC2538_RF_CHANNEL_MIN) *
CC2538_RF_CHANNEL_SPACING);
/* switch radio back on only if radio was on before - otherwise will turn on radio foor sleepy nodes */ /* switch radio back on only if radio was on before - otherwise will turn on radio foor sleepy nodes */
if(was_on) { if(was_on) {
on(); on();
@ -354,12 +355,12 @@ set_poll_mode(uint8_t enable)
if(enable) { if(enable) {
mac_timer_init(); mac_timer_init();
REG(RFCORE_XREG_RFIRQM0) &= ~RFCORE_XREG_RFIRQM0_FIFOP; // mask out FIFOP interrupt source REG(RFCORE_XREG_RFIRQM0) &= ~RFCORE_XREG_RFIRQM0_FIFOP; /* mask out FIFOP interrupt source */
REG(RFCORE_SFR_RFIRQF0) &= ~RFCORE_SFR_RFIRQF0_FIFOP; // clear pending FIFOP interrupt REG(RFCORE_SFR_RFIRQF0) &= ~RFCORE_SFR_RFIRQF0_FIFOP; /* clear pending FIFOP interrupt */
nvic_interrupt_disable(NVIC_INT_RF_RXTX); // disable RF interrupts nvic_interrupt_disable(NVIC_INT_RF_RXTX); /* disable RF interrupts */
} else { } else {
REG(RFCORE_XREG_RFIRQM0) |= RFCORE_XREG_RFIRQM0_FIFOP; // enable FIFOP interrupt source REG(RFCORE_XREG_RFIRQM0) |= RFCORE_XREG_RFIRQM0_FIFOP; /* enable FIFOP interrupt source */
nvic_interrupt_enable(NVIC_INT_RF_RXTX); // enable RF interrupts nvic_interrupt_enable(NVIC_INT_RF_RXTX); /* enable RF interrupts */
} }
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
@ -785,7 +786,7 @@ read(void *buf, unsigned short bufsize)
CC2538_RF_CSP_ISFLUSHRX(); CC2538_RF_CSP_ISFLUSHRX();
return (len); return len;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static int static int
@ -799,9 +800,9 @@ receiving_packet(void)
* *
* FSMSTAT1 & (TX_ACTIVE | SFD) == SFD <=> receiving * FSMSTAT1 & (TX_ACTIVE | SFD) == SFD <=> receiving
*/ */
return ((REG(RFCORE_XREG_FSMSTAT1) return (REG(RFCORE_XREG_FSMSTAT1)
& (RFCORE_XREG_FSMSTAT1_TX_ACTIVE | RFCORE_XREG_FSMSTAT1_SFD)) & (RFCORE_XREG_FSMSTAT1_TX_ACTIVE | RFCORE_XREG_FSMSTAT1_SFD))
== RFCORE_XREG_FSMSTAT1_SFD); == RFCORE_XREG_FSMSTAT1_SFD;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static int static int
@ -809,7 +810,7 @@ pending_packet(void)
{ {
PRINTF("RF: Pending\n"); PRINTF("RF: Pending\n");
return (REG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_FIFOP); return REG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_FIFOP;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static radio_result_t static radio_result_t