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 */