Skip to content

Commit

Permalink
Move #if/#else statements inside functions
Browse files Browse the repository at this point in the history
  • Loading branch information
evandavey committed Jun 8, 2021
1 parent e61a8ca commit 89789f2
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions connectivity/drivers/lora/COMPONENT_SX126X/SX126X_LoRaRadio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,9 +694,9 @@ void SX126X_LoRaRadio::read_fifo(uint8_t *buffer, uint8_t size, uint8_t offset)
_chip_select = 1;
}

#if MBED_CONF_SX126X_LORA_DRIVER_DEVICE_VARIANT == -1
uint8_t SX126X_LoRaRadio::get_device_variant(void)
{
#if MBED_CONF_SX126X_LORA_DRIVER_DEVICE_VARIANT == -1
uint16_t val = 0;
val = _dev_select.read_u16();

Expand All @@ -707,17 +707,14 @@ uint8_t SX126X_LoRaRadio::get_device_variant(void)
} else {
return SX1261;
}
}
#else
uint8_t SX126X_LoRaRadio::get_device_variant(void)
{
return MBED_CONF_SX126X_LORA_DRIVER_DEVICE_VARIANT;
}
#endif
}

#if MBED_CONF_SX126X_LORA_DRIVER_FREQ_SUPPORT == -1
uint8_t SX126X_LoRaRadio::get_frequency_support(void)
{
#if MBED_CONF_SX126X_LORA_DRIVER_FREQ_SUPPORT == -1
uint16_t val = 0;
val = _freq_select.read_u16();

Expand All @@ -736,13 +733,10 @@ uint8_t SX126X_LoRaRadio::get_frequency_support(void)
} else {
return (MATCHING_FREQ_868);
}
}
#else
uint8_t SX126X_LoRaRadio::get_frequency_support(void)
{
return MBED_CONF_SX126X_LORA_DRIVER_FREQ_SUPPORT;
}
#endif
}

uint8_t SX126X_LoRaRadio::get_fsk_bw_reg_val(uint32_t bandwidth)
{
Expand Down

0 comments on commit 89789f2

Please sign in to comment.