From 1ea06a885cc95e0aea1b9e71214314100961d094 Mon Sep 17 00:00:00 2001 From: smlng Date: Tue, 31 Jan 2017 13:51:55 +0100 Subject: [PATCH] drivers/kw2xrf: cleanup defines in main header file --- drivers/include/kw2xrf.h | 32 ++++++++++---------------------- drivers/kw2xrf/kw2xrf_getset.c | 10 +++++----- 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/drivers/include/kw2xrf.h b/drivers/include/kw2xrf.h index d09551a8a75d..9b0d7281be26 100644 --- a/drivers/include/kw2xrf.h +++ b/drivers/include/kw2xrf.h @@ -17,10 +17,11 @@ * * @author Johann Fischer * @author Jonas Remmert + * @author Sebastian Meiling */ -#ifndef MKW2XDRF_H -#define MKW2XDRF_H +#ifndef KW2XDRF_H +#define KW2XDRF_H #include @@ -38,33 +39,20 @@ extern "C" { /** * @brief Maximum packet length */ -#define KW2XRF_MAX_PKT_LENGTH (IEEE802154_FRAME_LEN_MAX) - -/** - * @brief Default short address used after initialization - */ -#define KW2XRF_DEFAULT_SHORT_ADDR (0x0042) - -/** - * @brief Default short address used after initialization - */ -#define KW2XRF_DEFAULT_ADDR_LONG (0x0000000DEADCAB1E) +#define KW2XRF_MAX_PKT_LENGTH (IEEE802154_FRAME_LEN_MAX) /** * @brief Default PAN ID used after initialization */ -#define KW2XRF_DEFAULT_PANID (IEEE802154_DEFAULT_PANID) +#define KW2XRF_DEFAULT_PANID (IEEE802154_DEFAULT_PANID) /** * @brief Default channel used after initialization * * @{ */ -#ifdef DEFAULT_CHANNEL -#define KW2XRF_DEFAULT_CHANNEL (DEFAULT_CHANNEL) -#endif #ifndef KW2XRF_DEFAULT_CHANNEL -#define KW2XRF_DEFAULT_CHANNEL (IEEE802154_DEFAULT_CHANNEL) +#define KW2XRF_DEFAULT_CHANNEL (IEEE802154_DEFAULT_CHANNEL) #endif /** @} */ @@ -80,17 +68,17 @@ extern "C" { /** * @brief Default TX_POWER in dbm used after initialization */ -#define KW2XRF_DEFAULT_TX_POWER (IEEE802154_DEFAULT_TXPOWER) +#define KW2XRF_DEFAULT_TX_POWER (IEEE802154_DEFAULT_TXPOWER) /** * @brief Maximum output power of the kw2x device in dBm */ -#define MKW2XDRF_OUTPUT_POWER_MAX (8) +#define KW2XDRF_OUTPUT_POWER_MAX (8) /** * @brief Minimum output power of the kw2x device in dBm */ -#define MKW2XDRF_OUTPUT_POWER_MIN (-35) +#define KW2XDRF_OUTPUT_POWER_MIN (-35) /** * @brief Internal device option flags @@ -182,5 +170,5 @@ void kw2xrf_reset_phy(kw2xrf_t *dev); } #endif -#endif /* MKW2XDRF_H */ +#endif /* KW2XDRF_H */ /** @} */ diff --git a/drivers/kw2xrf/kw2xrf_getset.c b/drivers/kw2xrf/kw2xrf_getset.c index 5f64b80eb805..5206b425bb0f 100644 --- a/drivers/kw2xrf/kw2xrf_getset.c +++ b/drivers/kw2xrf/kw2xrf_getset.c @@ -71,15 +71,15 @@ static const uint8_t pow_lt[44] = { void kw2xrf_set_tx_power(kw2xrf_t *dev, int16_t txpower) { - if (txpower > MKW2XDRF_OUTPUT_POWER_MAX) { - txpower = MKW2XDRF_OUTPUT_POWER_MAX; + if (txpower > KW2XDRF_OUTPUT_POWER_MAX) { + txpower = KW2XDRF_OUTPUT_POWER_MAX; } - if (txpower < MKW2XDRF_OUTPUT_POWER_MIN) { - txpower = MKW2XDRF_OUTPUT_POWER_MIN; + if (txpower < KW2XDRF_OUTPUT_POWER_MIN) { + txpower = KW2XDRF_OUTPUT_POWER_MIN; } - uint8_t level = pow_lt[txpower - MKW2XDRF_OUTPUT_POWER_MIN]; + uint8_t level = pow_lt[txpower - KW2XDRF_OUTPUT_POWER_MIN]; kw2xrf_write_dreg(dev, MKW2XDM_PA_PWR, MKW2XDM_PA_PWR(level)); dev->tx_power = txpower; }