This can just be made global at this point lol

This commit is contained in:
Willy-JL
2023-10-26 04:03:42 +01:00
parent f474e8c7ca
commit 28bcc09d9b
64 changed files with 249 additions and 286 deletions

View File

@@ -214,16 +214,15 @@ bool subghz_device_cc1101_ext_alloc(SubGhzDeviceConf* conf) {
subghz_device_cc1101_ext->async_rx.capture_delta_duration = 0;
subghz_device_cc1101_ext->spi_bus_handle =
(XTREME_SETTINGS()->spi_cc1101_handle == SpiDefault ?
(xtreme_settings.spi_cc1101_handle == SpiDefault ?
&furi_hal_spi_bus_handle_external :
&furi_hal_spi_bus_handle_external_extra);
// this is needed if multiple SPI devices are connected to the same bus but with different CS pins
if(XTREME_SETTINGS()->spi_cc1101_handle == SpiDefault &&
!furi_hal_subghz_get_ext_power_amp()) {
if(xtreme_settings.spi_cc1101_handle == SpiDefault && !furi_hal_subghz_get_ext_power_amp()) {
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeOutputPushPull);
furi_hal_gpio_write(&gpio_ext_pc3, true);
} else if(XTREME_SETTINGS()->spi_cc1101_handle == SpiExtra) {
} else if(xtreme_settings.spi_cc1101_handle == SpiExtra) {
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeOutputPushPull);
furi_hal_gpio_write(&gpio_ext_pa4, true);
}
@@ -245,9 +244,9 @@ void subghz_device_cc1101_ext_free() {
free(subghz_device_cc1101_ext);
// resetting the CS pins to floating
if(XTREME_SETTINGS()->spi_nrf24_handle == SpiDefault || subghz_device_cc1101_ext->power_amp) {
if(xtreme_settings.spi_nrf24_handle == SpiDefault || subghz_device_cc1101_ext->power_amp) {
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeAnalog);
} else if(XTREME_SETTINGS()->spi_nrf24_handle == SpiExtra) {
} else if(xtreme_settings.spi_nrf24_handle == SpiExtra) {
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeAnalog);
}