Skip to content

Commit

Permalink
fixup for travis
Browse files Browse the repository at this point in the history
  • Loading branch information
benemorius committed Mar 19, 2020
1 parent 41bf711 commit da58520
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 23 deletions.
13 changes: 6 additions & 7 deletions drivers/kw41zrf/include/kw41zrf_getset.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
extern "C" {
#endif


/**
* @name Internal device option flags
* @{
Expand Down Expand Up @@ -125,24 +124,24 @@ void kw41zrf_set_addr_long(kw41zrf_t *dev, const eui64_t *addr);
/**
* @brief Get short address of a given device
*
* @param[in] dev kw41zrf device descriptor
* @return current short address
* @param[in] dev kw41zrf device descriptor
* @param[out] addr current short address
*/
void kw41zrf_get_addr_short(kw41zrf_t *dev, network_uint16_t *addr);

/**
* @brief Get long address of a given device
*
* @param[in] dev kw41zrf device descriptor
* @return current long address
* @param[in] dev kw41zrf device descriptor
* @param[out] addr current long address
*/
void kw41zrf_get_addr_long(kw41zrf_t *dev, eui64_t *addr);

/**
* @brief Get CCA threshhold of a given device
* @brief Get CCA threshold of a given device
*
* @param[in] dev kw41zrf device descriptor
* @return current CCA threshhold
* @return current CCA threshold
*/
int8_t kw41zrf_get_cca_threshold(kw41zrf_t *dev);

Expand Down
1 change: 0 additions & 1 deletion drivers/kw41zrf/include/kw41zrf_intern.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@
#define KW41ZRF_LED_IRQ_OFF
#endif /* KW41ZRF_ENABLE_LEDS */


#ifdef __cplusplus
extern "C" {
#endif
Expand Down
2 changes: 1 addition & 1 deletion drivers/kw41zrf/kw41zrf.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ int kw41zrf_reset_hardware(kw41zrf_t *dev)
RSIM->CONTROL |= RSIM_CONTROL_RF_OSC_EN(1);

/* Wait for oscillator ready signal */
while((RSIM->CONTROL & RSIM_CONTROL_RF_OSC_READY_MASK) == 0) {}
while ((RSIM->CONTROL & RSIM_CONTROL_RF_OSC_READY_MASK) == 0) {}

/* Assert radio software reset */
RSIM->CONTROL |= RSIM_CONTROL_RADIO_RESET_BIT_MASK;
Expand Down
22 changes: 14 additions & 8 deletions drivers/kw41zrf/kw41zrf_getset.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,15 @@ int16_t kw41zrf_get_txpower(kw41zrf_t *dev)
uint8_t kw41zrf_get_channel(kw41zrf_t *dev)
{
(void) dev;
return (ZLL->CHANNEL_NUM0 & ZLL_CHANNEL_NUM0_CHANNEL_NUM0_MASK) >> ZLL_CHANNEL_NUM0_CHANNEL_NUM0_SHIFT;
return (ZLL->CHANNEL_NUM0 & ZLL_CHANNEL_NUM0_CHANNEL_NUM0_MASK)
>> ZLL_CHANNEL_NUM0_CHANNEL_NUM0_SHIFT;
}

uint16_t kw41zrf_get_pan(kw41zrf_t *dev)
{
(void) dev;
return (ZLL->MACSHORTADDRS0 & ZLL_MACSHORTADDRS0_MACPANID0_MASK) >> ZLL_MACSHORTADDRS0_MACPANID0_SHIFT;
return (ZLL->MACSHORTADDRS0 & ZLL_MACSHORTADDRS0_MACPANID0_MASK)
>> ZLL_MACSHORTADDRS0_MACPANID0_SHIFT;
}

int kw41zrf_set_channel(kw41zrf_t *dev, uint8_t channel)
Expand All @@ -104,17 +106,19 @@ int kw41zrf_set_channel(kw41zrf_t *dev, uint8_t channel)
void kw41zrf_set_pan(kw41zrf_t *dev, uint16_t pan)
{
(void) dev;
ZLL->MACSHORTADDRS0 = (ZLL->MACSHORTADDRS0 & ~ZLL_MACSHORTADDRS0_MACPANID0_MASK) |
ZLL_MACSHORTADDRS0_MACPANID0(pan);
ZLL->MACSHORTADDRS0 = (ZLL->MACSHORTADDRS0
& ~ZLL_MACSHORTADDRS0_MACPANID0_MASK) |
ZLL_MACSHORTADDRS0_MACPANID0(pan);

DEBUG("[kw41zrf] set pan to: 0x%x\n", pan);
}

void kw41zrf_set_addr_short(kw41zrf_t *dev, const network_uint16_t *addr)
{
(void) dev;
ZLL->MACSHORTADDRS0 = (ZLL->MACSHORTADDRS0 & ~ZLL_MACSHORTADDRS0_MACSHORTADDRS0_MASK) |
ZLL_MACSHORTADDRS0_MACSHORTADDRS0(addr->u16);
ZLL->MACSHORTADDRS0 = (ZLL->MACSHORTADDRS0
& ~ZLL_MACSHORTADDRS0_MACSHORTADDRS0_MASK) |
ZLL_MACSHORTADDRS0_MACSHORTADDRS0(addr->u16);
}

void kw41zrf_set_addr_long(kw41zrf_t *dev, const eui64_t *addr)
Expand Down Expand Up @@ -169,7 +173,8 @@ uint8_t kw41zrf_get_cca_mode(kw41zrf_t *dev)
int8_t kw41zrf_get_ed_level(kw41zrf_t *dev)
{
(void) dev;
return (ZLL->LQI_AND_RSSI & ZLL_LQI_AND_RSSI_CCA1_ED_FNL_MASK) >> ZLL_LQI_AND_RSSI_CCA1_ED_FNL_SHIFT;
return (ZLL->LQI_AND_RSSI & ZLL_LQI_AND_RSSI_CCA1_ED_FNL_MASK)
>> ZLL_LQI_AND_RSSI_CCA1_ED_FNL_SHIFT;
}

void kw41zrf_set_option(kw41zrf_t *dev, uint8_t option, uint8_t state)
Expand All @@ -186,7 +191,8 @@ void kw41zrf_set_option(kw41zrf_t *dev, uint8_t option, uint8_t state)
case KW41ZRF_OPT_AUTOACK:
case KW41ZRF_OPT_ACK_PENDING:
case KW41ZRF_OPT_TELL_RX_START:
LOG_ERROR("[kw41zrf] Attempt to modify option %04x while radio is sleeping\n", (unsigned) option);
LOG_ERROR("[kw41zrf] Attempt to modify option %04x while radio is sleeping\n",
(unsigned) option);
assert(0);
return;

Expand Down
2 changes: 1 addition & 1 deletion drivers/kw41zrf/kw41zrf_intern.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void kw41zrf_set_power_mode(kw41zrf_t *dev, kw41zrf_powermode_t pm)
RSIM->DSM_CONTROL = (RSIM_DSM_CONTROL_DSM_TIMER_EN_MASK |
RSIM_DSM_CONTROL_ZIG_SYSCLK_REQUEST_EN_MASK);
/* Wait for oscillator ready signal before attempting to recover from DSM */
while((RSIM->CONTROL & RSIM_CONTROL_RF_OSC_READY_MASK) == 0) {}
while ((RSIM->CONTROL & RSIM_CONTROL_RF_OSC_READY_MASK) == 0) {}
KW41ZRF_LED_NDSM_ON;
/* If we are already awake we can just return now. */
if (!(kw41zrf_is_dsm())) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/kw41zrf/kw41zrf_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ int kw41zrf_netdev_get(netdev_t *netdev, netopt_t opt, void *value, size_t len)
else {
/* Wait for oscillator ready signal if the CPU is coming out of low
* power mode */
while((RSIM->CONTROL & RSIM_CONTROL_RF_OSC_READY_MASK) == 0) {}
while ((RSIM->CONTROL & RSIM_CONTROL_RF_OSC_READY_MASK) == 0) {}
}

int res = -ENOTSUP;
Expand Down
8 changes: 4 additions & 4 deletions drivers/kw41zrf/kw41zrf_xcvr.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
static void kw41zrf_xcvr_spin(uint32_t time)
{
time *= 32; /* Time delay is roughly in uSec. */
while(time > 0)
while (time > 0)
{
__asm__ volatile ("" ::: "memory");
--time;
Expand Down Expand Up @@ -713,7 +713,7 @@ static int kw41zrf_xcvr_configure(kw41zrf_t *dev,
XCVR_TSM->CTRL &= ~XCVR_TSM_CTRL_DATA_PADDING_EN_MASK;
}

XCVR_MISC->LPPS_CTRL = com_config->lpps_ctrl_init; /* Register is in XCVR_MISC but grouped with TSM for intialization */
XCVR_MISC->LPPS_CTRL = com_config->lpps_ctrl_init; /* Register is in XCVR_MISC but grouped with TSM for initialization */

XCVR_TSM->OVRD2 = com_config->tsm_ovrd2_init;
/* TSM registers and timings - dependent upon clock frequency */
Expand Down Expand Up @@ -887,10 +887,10 @@ int kw41zrf_xcvr_init(kw41zrf_t *dev)
{TRIM_STATUS, 0, 0}, /*< Fetch the trim status word if available.*/
{TRIM_VERSION, 0, 0} /*< Fetch the trim version number if available.*/
};
handle_ifr(&sw_trim_tbl[0], sizeof(sw_trim_tbl) / sizeof(sw_trim_tbl[0]));
handle_ifr(&sw_trim_tbl[0], ARRAY_SIZE(sw_trim_tbl));
DEBUG("[kw41zrf] sw_trim_tbl:\n");

for (unsigned k = 0; k < sizeof(sw_trim_tbl) / sizeof(sw_trim_tbl[0]); ++k) {
for (unsigned k = 0; k < ARRAY_SIZE(sw_trim_tbl); ++k) {
DEBUG("[kw41zrf] [%u] id=0x%04x ", k, (unsigned)sw_trim_tbl[k].trim_id);
if (sw_trim_tbl[k].trim_id == TRIM_STATUS) {
DEBUG("(TRIM_STATUS) ");
Expand Down

0 comments on commit da58520

Please sign in to comment.