net/lora : Move 'LORA_BW_DEFAULT' to 'CONFIG_'
Added choices and moved 'LORA_BW_DEFAULT" to 'CONFIG_' namespace
This commit is contained in:
parent
979700cd45
commit
349d20349d
@ -171,7 +171,7 @@ void sx127x_init_radio_settings(sx127x_t *dev)
|
|||||||
sx127x_set_channel(dev, SX127X_CHANNEL_DEFAULT);
|
sx127x_set_channel(dev, SX127X_CHANNEL_DEFAULT);
|
||||||
sx127x_set_modem(dev, SX127X_MODEM_DEFAULT);
|
sx127x_set_modem(dev, SX127X_MODEM_DEFAULT);
|
||||||
sx127x_set_tx_power(dev, SX127X_RADIO_TX_POWER);
|
sx127x_set_tx_power(dev, SX127X_RADIO_TX_POWER);
|
||||||
sx127x_set_bandwidth(dev, LORA_BW_DEFAULT);
|
sx127x_set_bandwidth(dev, CONFIG_LORA_BW_DEFAULT);
|
||||||
sx127x_set_spreading_factor(dev, LORA_SF_DEFAULT);
|
sx127x_set_spreading_factor(dev, LORA_SF_DEFAULT);
|
||||||
sx127x_set_coding_rate(dev, LORA_CR_DEFAULT);
|
sx127x_set_coding_rate(dev, LORA_CR_DEFAULT);
|
||||||
sx127x_set_crc(dev, LORA_PAYLOAD_CRC_ON_DEFAULT);
|
sx127x_set_crc(dev, LORA_PAYLOAD_CRC_ON_DEFAULT);
|
||||||
|
|||||||
@ -24,6 +24,8 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "kernel_defines.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@ -48,9 +50,17 @@ extern "C" {
|
|||||||
#define CONFIG_LORA_SYMBOL_TIMEOUT_DEFAULT (10U)
|
#define CONFIG_LORA_SYMBOL_TIMEOUT_DEFAULT (10U)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if IS_ACTIVE(CONFIG_LORA_BW_DEFAULT_125)
|
||||||
|
#define CONFIG_LORA_BW_DEFAULT (LORA_BW_125_KHZ)
|
||||||
|
#elif IS_ACTIVE(CONFIG_LORA_BW_DEFAULT_250)
|
||||||
|
#define CONFIG_LORA_BW_DEFAULT (LORA_BW_250_KHZ)
|
||||||
|
#elif IS_ACTIVE(CONFIG_LORA_BW_DEFAULT_500)
|
||||||
|
#define CONFIG_LORA_BW_DEFAULT (LORA_BW_500_KHZ)
|
||||||
|
#endif
|
||||||
|
|
||||||
/** @brief Set default bandwidth to 125kHz */
|
/** @brief Set default bandwidth to 125kHz */
|
||||||
#ifndef LORA_BW_DEFAULT
|
#ifndef CONFIG_LORA_BW_DEFAULT
|
||||||
#define LORA_BW_DEFAULT (LORA_BW_125_KHZ)
|
#define CONFIG_LORA_BW_DEFAULT (LORA_BW_125_KHZ)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** @brief Set default spreading factor to 12 */
|
/** @brief Set default spreading factor to 12 */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user