Fixed code style issues

This commit is contained in:
Carlos Pérez Penichet 2018-10-29 11:15:40 +01:00
parent a906f03a25
commit 2d2d6b3ad6
2 changed files with 10 additions and 10 deletions

View File

@ -396,9 +396,9 @@ get_sfd_timestamp(void)
return RTIMER_NOW() - RADIO_TO_RTIMER(timer_val - sfd); return RTIMER_NOW() - RADIO_TO_RTIMER(timer_val - sfd);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* Enable or disable radio test mode emmiting modulated or unmodulated /* Enable or disable radio test mode emmiting modulated or unmodulated
* (carrier) signal. See User's Guide pages 719 and 741. * (carrier) signal. See User's Guide pages 719 and 741.
*/ */
static uint32_t prev_FRMCTRL0, prev_MDMTEST1; static uint32_t prev_FRMCTRL0, prev_MDMTEST1;
static uint8_t was_on; static uint8_t was_on;
@ -407,7 +407,7 @@ set_test_mode(uint8_t enable, uint8_t modulated)
{ {
radio_value_t mode; radio_value_t mode;
get_value(RADIO_PARAM_POWER_MODE, &mode); get_value(RADIO_PARAM_POWER_MODE, &mode);
if(enable) { if(enable) {
if(mode == RADIO_POWER_MODE_CARRIER_ON) { if(mode == RADIO_POWER_MODE_CARRIER_ON) {
return; return;
@ -416,7 +416,7 @@ set_test_mode(uint8_t enable, uint8_t modulated)
off(); off();
prev_FRMCTRL0 = REG(RFCORE_XREG_FRMCTRL0); prev_FRMCTRL0 = REG(RFCORE_XREG_FRMCTRL0);
/* This constantly transmits random data */ /* This constantly transmits random data */
REG(RFCORE_XREG_FRMCTRL0) = 0x00000042; REG(RFCORE_XREG_FRMCTRL0) = 0x00000042;
if(!modulated) { if(!modulated) {
prev_MDMTEST1 = REG(RFCORE_XREG_MDMTEST1); prev_MDMTEST1 = REG(RFCORE_XREG_MDMTEST1);
/* ...adding this we send an unmodulated carrier instead */ /* ...adding this we send an unmodulated carrier instead */
@ -850,7 +850,7 @@ get_value(radio_param_t param, radio_value_t *value)
switch(param) { switch(param) {
case RADIO_PARAM_POWER_MODE: case RADIO_PARAM_POWER_MODE:
if ((REG(RFCORE_XREG_RXENABLE) & RFCORE_XREG_RXENABLE_RXENMASK) == 0) { if((REG(RFCORE_XREG_RXENABLE) & RFCORE_XREG_RXENABLE_RXENMASK) == 0) {
*value = RADIO_POWER_MODE_OFF; *value = RADIO_POWER_MODE_OFF;
} else { } else {
*value = (REG(RFCORE_XREG_FRMCTRL0) & RFCORE_XREG_FRMCTRL0_TX_MODE) == 0 *value = (REG(RFCORE_XREG_FRMCTRL0) & RFCORE_XREG_FRMCTRL0_TX_MODE) == 0
@ -943,7 +943,7 @@ set_value(radio_param_t param, radio_value_t value)
if(value == RADIO_POWER_MODE_OFF) { if(value == RADIO_POWER_MODE_OFF) {
off(); off();
return RADIO_RESULT_OK; return RADIO_RESULT_OK;
} }
if(value == RADIO_POWER_MODE_CARRIER_ON || if(value == RADIO_POWER_MODE_CARRIER_ON ||
value == RADIO_POWER_MODE_CARRIER_OFF) { value == RADIO_POWER_MODE_CARRIER_OFF) {
set_test_mode((value == RADIO_POWER_MODE_CARRIER_ON), 0); set_test_mode((value == RADIO_POWER_MODE_CARRIER_ON), 0);

View File

@ -1132,9 +1132,9 @@ set_send_on_cca(uint8_t enable)
send_on_cca = enable; send_on_cca = enable;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* Enable or disable radio test mode emmiting modulated or unmodulated /* Enable or disable radio test mode emmiting modulated or unmodulated
* (carrier) signal. See datasheet page 55. * (carrier) signal. See datasheet page 55.
*/ */
static uint16_t prev_MDMCTRL1, prev_DACTST; static uint16_t prev_MDMCTRL1, prev_DACTST;
static uint8_t was_on; static uint8_t was_on;
@ -1151,12 +1151,12 @@ set_test_mode(uint8_t enable, uint8_t modulated)
was_on = (mode == RADIO_POWER_MODE_ON); was_on = (mode == RADIO_POWER_MODE_ON);
off(); off();
prev_MDMCTRL1 = getreg(CC2420_MDMCTRL1); prev_MDMCTRL1 = getreg(CC2420_MDMCTRL1);
setreg(CC2420_MDMCTRL1, 0x050C); setreg(CC2420_MDMCTRL1, 0x050C);
if(!modulated) { if(!modulated) {
prev_DACTST = getreg(CC2420_DACTST); prev_DACTST = getreg(CC2420_DACTST);
setreg(CC2420_DACTST, 0x1800); setreg(CC2420_DACTST, 0x1800);
} }
/* actually starts the test mode */ /* actually starts the test mode */
strobe(CC2420_STXON); strobe(CC2420_STXON);
} else { } else {
if(mode != RADIO_POWER_MODE_CARRIER_ON) { if(mode != RADIO_POWER_MODE_CARRIER_ON) {