Skip to content

Commit 89789f2

Browse files
committed
Move #if/#else statements inside functions
1 parent e61a8ca commit 89789f2

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

connectivity/drivers/lora/COMPONENT_SX126X/SX126X_LoRaRadio.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -694,9 +694,9 @@ void SX126X_LoRaRadio::read_fifo(uint8_t *buffer, uint8_t size, uint8_t offset)
694694
_chip_select = 1;
695695
}
696696

697-
#if MBED_CONF_SX126X_LORA_DRIVER_DEVICE_VARIANT == -1
698697
uint8_t SX126X_LoRaRadio::get_device_variant(void)
699698
{
699+
#if MBED_CONF_SX126X_LORA_DRIVER_DEVICE_VARIANT == -1
700700
uint16_t val = 0;
701701
val = _dev_select.read_u16();
702702

@@ -707,17 +707,14 @@ uint8_t SX126X_LoRaRadio::get_device_variant(void)
707707
} else {
708708
return SX1261;
709709
}
710-
}
711710
#else
712-
uint8_t SX126X_LoRaRadio::get_device_variant(void)
713-
{
714711
return MBED_CONF_SX126X_LORA_DRIVER_DEVICE_VARIANT;
715-
}
716712
#endif
713+
}
717714

718-
#if MBED_CONF_SX126X_LORA_DRIVER_FREQ_SUPPORT == -1
719715
uint8_t SX126X_LoRaRadio::get_frequency_support(void)
720716
{
717+
#if MBED_CONF_SX126X_LORA_DRIVER_FREQ_SUPPORT == -1
721718
uint16_t val = 0;
722719
val = _freq_select.read_u16();
723720

@@ -736,13 +733,10 @@ uint8_t SX126X_LoRaRadio::get_frequency_support(void)
736733
} else {
737734
return (MATCHING_FREQ_868);
738735
}
739-
}
740736
#else
741-
uint8_t SX126X_LoRaRadio::get_frequency_support(void)
742-
{
743737
return MBED_CONF_SX126X_LORA_DRIVER_FREQ_SUPPORT;
744-
}
745738
#endif
739+
}
746740

747741
uint8_t SX126X_LoRaRadio::get_fsk_bw_reg_val(uint32_t bandwidth)
748742
{

0 commit comments

Comments
 (0)