From c0369f04f63c672ed9a32904edfedfe5e6b17a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cenk=20G=C3=BCndo=C4=9Fan?= Date: Tue, 16 Feb 2016 13:07:17 +0100 Subject: [PATCH] drivers: make default channel configurable at compile time --- drivers/cc110x/include/cc110x-internal.h | 2 ++ drivers/include/at86rf2xx.h | 4 ++++ drivers/include/kw2xrf.h | 2 ++ drivers/include/xbee.h | 2 ++ drivers/nrf24l01p/include/nrf24l01p_settings.h | 2 ++ 5 files changed, 12 insertions(+) diff --git a/drivers/cc110x/include/cc110x-internal.h b/drivers/cc110x/include/cc110x-internal.h index 5d51697dff..8ccdd402fc 100644 --- a/drivers/cc110x/include/cc110x-internal.h +++ b/drivers/cc110x/include/cc110x-internal.h @@ -56,7 +56,9 @@ extern "C" { after CS */ #define CC110X_GDO1_LOW_RETRY (100) /**< Max. retries for SO to go low after CS */ +#ifndef CC100X_DEFAULT_CHANNEL #define CC110X_DEFAULT_CHANNEL (0) /**< The default channel number */ +#endif #define CC110X_MIN_CHANNR (0) /**< lowest possible channel number */ #define CC110X_MAX_CHANNR (0) /**< highest possible channel number */ diff --git a/drivers/include/at86rf2xx.h b/drivers/include/at86rf2xx.h index adf2f4da85..f2e63d7cb1 100644 --- a/drivers/include/at86rf2xx.h +++ b/drivers/include/at86rf2xx.h @@ -61,12 +61,16 @@ extern "C" { /* the AT86RF212B has a sub-1GHz radio */ #define AT86RF2XX_MIN_CHANNEL (0) #define AT86RF2XX_MAX_CHANNEL (10) +#ifndef AT86RF2XX_DEFAULT_CHANNEL #define AT86RF2XX_DEFAULT_CHANNEL (5) +#endif #else #define AT86RF2XX_MIN_CHANNEL (11U) #define AT86RF2XX_MAX_CHANNEL (26U) +#ifndef AT86RF2XX_DEFAULT_CHANNEL #define AT86RF2XX_DEFAULT_CHANNEL (26U) #endif +#endif /** @} */ /** diff --git a/drivers/include/kw2xrf.h b/drivers/include/kw2xrf.h index 54f5db1ca1..21cc44c6bc 100644 --- a/drivers/include/kw2xrf.h +++ b/drivers/include/kw2xrf.h @@ -65,7 +65,9 @@ extern "C" { /** * @brief Default channel used after initialization */ +#ifndef KW2XRF_DEFAULT_CHANNEL #define KW2XRF_DEFAULT_CHANNEL (26U) +#endif /** * @brief Default TX_POWER in dbm used after initialization diff --git a/drivers/include/xbee.h b/drivers/include/xbee.h index 727d79353d..3b355a1d37 100644 --- a/drivers/include/xbee.h +++ b/drivers/include/xbee.h @@ -68,7 +68,9 @@ extern "C" { /** * @brief Default channel used after initialization */ +#ifndef XBEE_DEFAULT_CHANNEL #define XBEE_DEFAULT_CHANNEL (26U) +#endif /** * @name Address flags diff --git a/drivers/nrf24l01p/include/nrf24l01p_settings.h b/drivers/nrf24l01p/include/nrf24l01p_settings.h index 41ff3cdd0e..c380b493e2 100644 --- a/drivers/nrf24l01p/include/nrf24l01p_settings.h +++ b/drivers/nrf24l01p/include/nrf24l01p_settings.h @@ -28,7 +28,9 @@ extern "C" { #define INITIAL_ADDRESS_WIDTH 5 #define NRF24L01P_MAX_DATA_LENGTH 32 +#ifndef INITIAL_RF_CHANNEL #define INITIAL_RF_CHANNEL 5 +#endif #define INITIAL_RX_POWER_0dB 0 #define DELAY_CS_TOGGLE_TICKS 2