diff --git a/drivers/kw41zrf/include/kw41zrf_getset.h b/drivers/kw41zrf/include/kw41zrf_getset.h index 215ae9a24e5aa..5148941912269 100644 --- a/drivers/kw41zrf/include/kw41zrf_getset.h +++ b/drivers/kw41zrf/include/kw41zrf_getset.h @@ -26,7 +26,6 @@ extern "C" { #endif - /** * @name Internal device option flags * @{ @@ -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); diff --git a/drivers/kw41zrf/include/kw41zrf_intern.h b/drivers/kw41zrf/include/kw41zrf_intern.h index ddf66273b3654..5f66f2df0a2a4 100644 --- a/drivers/kw41zrf/include/kw41zrf_intern.h +++ b/drivers/kw41zrf/include/kw41zrf_intern.h @@ -100,7 +100,6 @@ #define KW41ZRF_LED_IRQ_OFF #endif /* KW41ZRF_ENABLE_LEDS */ - #ifdef __cplusplus extern "C" { #endif diff --git a/drivers/kw41zrf/kw41zrf.c b/drivers/kw41zrf/kw41zrf.c index 9b1f7013b154b..04953c1e11120 100644 --- a/drivers/kw41zrf/kw41zrf.c +++ b/drivers/kw41zrf/kw41zrf.c @@ -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; diff --git a/drivers/kw41zrf/kw41zrf_getset.c b/drivers/kw41zrf/kw41zrf_getset.c index f0d7769821d1d..d0b2539f421b4 100644 --- a/drivers/kw41zrf/kw41zrf_getset.c +++ b/drivers/kw41zrf/kw41zrf_getset.c @@ -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) @@ -104,8 +106,9 @@ 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); } @@ -113,8 +116,9 @@ void kw41zrf_set_pan(kw41zrf_t *dev, uint16_t 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) @@ -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) @@ -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; diff --git a/drivers/kw41zrf/kw41zrf_intern.c b/drivers/kw41zrf/kw41zrf_intern.c index 3fe94230d543a..7ccbacb0ebd87 100644 --- a/drivers/kw41zrf/kw41zrf_intern.c +++ b/drivers/kw41zrf/kw41zrf_intern.c @@ -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())) { diff --git a/drivers/kw41zrf/kw41zrf_netdev.c b/drivers/kw41zrf/kw41zrf_netdev.c index 6d76c9ad4f3de..19178c35ef3c8 100644 --- a/drivers/kw41zrf/kw41zrf_netdev.c +++ b/drivers/kw41zrf/kw41zrf_netdev.c @@ -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; diff --git a/drivers/kw41zrf/kw41zrf_xcvr.c b/drivers/kw41zrf/kw41zrf_xcvr.c index 11e90ef7ff811..89b08fdccdcc9 100644 --- a/drivers/kw41zrf/kw41zrf_xcvr.c +++ b/drivers/kw41zrf/kw41zrf_xcvr.c @@ -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; @@ -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 */ @@ -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) ");