Fix code style
This commit is contained in:
parent
0313f9abf1
commit
833dc89f7c
|
@ -185,8 +185,8 @@ get_channel()
|
|||
{
|
||||
uint8_t chan = REG(RFCORE_XREG_FREQCTRL) & RFCORE_XREG_FREQCTRL_FREQ;
|
||||
|
||||
return ((chan - CC2538_RF_CHANNEL_MIN) / CC2538_RF_CHANNEL_SPACING
|
||||
+ CC2538_RF_CHANNEL_MIN);
|
||||
return (chan - CC2538_RF_CHANNEL_MIN) / CC2538_RF_CHANNEL_SPACING
|
||||
+ CC2538_RF_CHANNEL_MIN;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
|
@ -213,8 +213,9 @@ set_channel(uint8_t channel)
|
|||
was_on = 1;
|
||||
off();
|
||||
}
|
||||
REG(RFCORE_XREG_FREQCTRL) = (CC2538_RF_CHANNEL_MIN
|
||||
+ (channel - CC2538_RF_CHANNEL_MIN) * CC2538_RF_CHANNEL_SPACING);
|
||||
REG(RFCORE_XREG_FREQCTRL) = (CC2538_RF_CHANNEL_MIN +
|
||||
(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 */
|
||||
if(was_on) {
|
||||
on();
|
||||
|
@ -354,12 +355,12 @@ set_poll_mode(uint8_t enable)
|
|||
|
||||
if(enable) {
|
||||
mac_timer_init();
|
||||
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
|
||||
nvic_interrupt_disable(NVIC_INT_RF_RXTX); // disable RF interrupts
|
||||
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 */
|
||||
nvic_interrupt_disable(NVIC_INT_RF_RXTX); /* disable RF interrupts */
|
||||
} else {
|
||||
REG(RFCORE_XREG_RFIRQM0) |= RFCORE_XREG_RFIRQM0_FIFOP; // enable FIFOP interrupt source
|
||||
nvic_interrupt_enable(NVIC_INT_RF_RXTX); // enable RF interrupts
|
||||
REG(RFCORE_XREG_RFIRQM0) |= RFCORE_XREG_RFIRQM0_FIFOP; /* enable FIFOP interrupt source */
|
||||
nvic_interrupt_enable(NVIC_INT_RF_RXTX); /* enable RF interrupts */
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
@ -785,7 +786,7 @@ read(void *buf, unsigned short bufsize)
|
|||
|
||||
CC2538_RF_CSP_ISFLUSHRX();
|
||||
|
||||
return (len);
|
||||
return len;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
|
@ -799,9 +800,9 @@ receiving_packet(void)
|
|||
*
|
||||
* 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_SFD);
|
||||
== RFCORE_XREG_FSMSTAT1_SFD;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
|
@ -809,7 +810,7 @@ pending_packet(void)
|
|||
{
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue