From 00cc04f59659928bb59e41f4bf17d50359b5f0f1 Mon Sep 17 00:00:00 2001 From: Akshai M Date: Tue, 8 Sep 2020 19:50:41 +0530 Subject: [PATCH] net/lora : Model as bool 'LORA_IQ_INVERTED_DEFAULT' Move 'LORA_IQ_INVERTED_DEFAULT' to 'CONFIG_' --- drivers/sx127x/sx127x.c | 3 ++- sys/include/net/lora.h | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/sx127x/sx127x.c b/drivers/sx127x/sx127x.c index 0c2b7f0757..89b9ba627c 100644 --- a/drivers/sx127x/sx127x.c +++ b/drivers/sx127x/sx127x.c @@ -27,6 +27,7 @@ #include "timex.h" #include "ztimer.h" #include "thread.h" +#include "kernel_defines.h" #include "periph/gpio.h" #include "periph/spi.h" @@ -178,7 +179,7 @@ void sx127x_init_radio_settings(sx127x_t *dev) sx127x_set_freq_hop(dev, LORA_FREQUENCY_HOPPING_DEFAULT); sx127x_set_hop_period(dev, LORA_FREQUENCY_HOPPING_PERIOD_DEFAULT); sx127x_set_fixed_header_len_mode(dev, LORA_FIXED_HEADER_LEN_MODE_DEFAULT); - sx127x_set_iq_invert(dev, LORA_IQ_INVERTED_DEFAULT); + sx127x_set_iq_invert(dev, IS_ACTIVE(CONFIG_LORA_IQ_INVERTED_DEFAULT) ? true : false); sx127x_set_payload_length(dev, LORA_PAYLOAD_LENGTH_DEFAULT); sx127x_set_preamble_length(dev, CONFIG_LORA_PREAMBLE_LENGTH_DEFAULT); sx127x_set_symbol_timeout(dev, CONFIG_LORA_SYMBOL_TIMEOUT_DEFAULT); diff --git a/sys/include/net/lora.h b/sys/include/net/lora.h index 63bcb281ce..b3c2e9e20d 100644 --- a/sys/include/net/lora.h +++ b/sys/include/net/lora.h @@ -104,9 +104,9 @@ extern "C" { #define LORA_FIX_LENGTH_PAYLOAD_ON_DEFAULT (false) #endif -/** @brief Set inverted IQ on */ -#ifndef LORA_IQ_INVERTED_DEFAULT -#define LORA_IQ_INVERTED_DEFAULT (false) +/** @brief Set this to true to enable inverted IQ mode */ +#ifdef DOXYGEN +#define CONFIG_LORA_IQ_INVERTED_DEFAULT #endif /** @brief Frequency hopping on */