1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

net/lora : Move 'LORA_SF_DEFAULT' to 'CONFIG_'

This commit is contained in:
Akshai M 2020-09-08 19:07:01 +05:30
parent 349d20349d
commit aaeed98277
2 changed files with 19 additions and 3 deletions

View File

@ -172,7 +172,7 @@ void sx127x_init_radio_settings(sx127x_t *dev)
sx127x_set_modem(dev, SX127X_MODEM_DEFAULT);
sx127x_set_tx_power(dev, SX127X_RADIO_TX_POWER);
sx127x_set_bandwidth(dev, CONFIG_LORA_BW_DEFAULT);
sx127x_set_spreading_factor(dev, LORA_SF_DEFAULT);
sx127x_set_spreading_factor(dev, CONFIG_LORA_SF_DEFAULT);
sx127x_set_coding_rate(dev, LORA_CR_DEFAULT);
sx127x_set_crc(dev, LORA_PAYLOAD_CRC_ON_DEFAULT);
sx127x_set_freq_hop(dev, LORA_FREQUENCY_HOPPING_DEFAULT);

View File

@ -63,9 +63,25 @@ extern "C" {
#define CONFIG_LORA_BW_DEFAULT (LORA_BW_125_KHZ)
#endif
#if IS_ACTIVE(CONFIG_LORA_SF_DEFAULT_SF6)
#define CONFIG_LORA_SF_DEFAULT (LORA_SF6)
#elif IS_ACTIVE(CONFIG_LORA_SF_DEFAULT_SF7)
#define CONFIG_LORA_SF_DEFAULT (LORA_SF7)
#elif IS_ACTIVE(CONFIG_LORA_SF_DEFAULT_SF8)
#define CONFIG_LORA_SF_DEFAULT (LORA_SF8)
#elif IS_ACTIVE(CONFIG_LORA_SF_DEFAULT_SF9)
#define CONFIG_LORA_SF_DEFAULT (LORA_SF9)
#elif IS_ACTIVE(CONFIG_LORA_SF_DEFAULT_SF10)
#define CONFIG_LORA_SF_DEFAULT (LORA_SF10)
#elif IS_ACTIVE(CONFIG_LORA_SF_DEFAULT_SF11)
#define CONFIG_LORA_SF_DEFAULT (LORA_SF11)
#elif IS_ACTIVE(CONFIG_LORA_SF_DEFAULT_SF12)
#define CONFIG_LORA_SF_DEFAULT (LORA_SF12)
#endif
/** @brief Set default spreading factor to 12 */
#ifndef LORA_SF_DEFAULT
#define LORA_SF_DEFAULT (LORA_SF12)
#ifndef CONFIG_LORA_SF_DEFAULT
#define CONFIG_LORA_SF_DEFAULT (LORA_SF12)
#endif
/** @brief Set default coding rate to 8 */