mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
This can just be made global at this point lol
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user