subrem_configurator app: Upd TXRX

This commit is contained in:
gid9798
2023-07-03 14:16:43 +03:00
parent 2ef07a7a6c
commit 90ed11e5e1
2 changed files with 8 additions and 4 deletions

View File

@@ -64,6 +64,7 @@ SubGhzTxRx* subghz_txrx_alloc() {
//set default device Internal
subghz_devices_init();
instance->radio_device_type = SubGhzRadioDeviceTypeInternal;
instance->radio_device_type =
subghz_txrx_radio_device_set(instance, SubGhzRadioDeviceTypeInternal);
@@ -570,7 +571,7 @@ void subghz_txrx_set_raw_file_encoder_worker_callback_end(
context);
}
bool subghz_txrx_radio_device_is_connect_external(SubGhzTxRx* instance, const char* name) {
bool subghz_txrx_radio_device_is_external_connected(SubGhzTxRx* instance, const char* name) {
furi_assert(instance);
bool is_connect = false;
@@ -580,7 +581,10 @@ bool subghz_txrx_radio_device_is_connect_external(SubGhzTxRx* instance, const ch
subghz_txrx_radio_device_power_on(instance);
}
is_connect = subghz_devices_is_connect(subghz_devices_get_by_name(name));
const SubGhzDevice* device = subghz_devices_get_by_name(name);
if(device) {
is_connect = subghz_devices_is_connect(device);
}
if(!is_otg_enabled) {
subghz_txrx_radio_device_power_off(instance);
@@ -593,7 +597,7 @@ SubGhzRadioDeviceType
furi_assert(instance);
if(radio_device_type == SubGhzRadioDeviceTypeExternalCC1101 &&
subghz_txrx_radio_device_is_connect_external(instance, SUBGHZ_DEVICE_CC1101_EXT_NAME)) {
subghz_txrx_radio_device_is_external_connected(instance, SUBGHZ_DEVICE_CC1101_EXT_NAME)) {
subghz_txrx_radio_device_power_on(instance);
instance->radio_device = subghz_devices_get_by_name(SUBGHZ_DEVICE_CC1101_EXT_NAME);
subghz_devices_begin(instance->radio_device);

View File

@@ -326,7 +326,7 @@ void subghz_txrx_set_raw_file_encoder_worker_callback_end(
* @param name Name of external radio device
* @return bool True if is connected to the external radio device
*/
bool subghz_txrx_radio_device_is_connect_external(SubGhzTxRx* instance, const char* name);
bool subghz_txrx_radio_device_is_external_connected(SubGhzTxRx* instance, const char* name);
/* Set the selected radio device to use
*