mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
subghz - fix check, fix typos
temporarily replace with internal check, commented code in function added TODO comment
This commit is contained in:
@@ -629,13 +629,16 @@ const char* subghz_txrx_radio_device_get_name(SubGhzTxRx* instance) {
|
||||
return subghz_devices_get_name(instance->radio_device);
|
||||
}
|
||||
|
||||
bool subghz_txrx_radio_device_is_frequecy_valid(SubGhzTxRx* instance, uint32_t frequency) {
|
||||
bool subghz_txrx_radio_device_is_frequency_valid(SubGhzTxRx* instance, uint32_t frequency) {
|
||||
furi_assert(instance);
|
||||
return subghz_devices_is_frequency_valid(instance->radio_device, frequency);
|
||||
}
|
||||
|
||||
bool subghz_txrx_radio_device_is_tx_alowed(SubGhzTxRx* instance, uint32_t frequency) {
|
||||
bool subghz_txrx_radio_device_is_tx_allowed(SubGhzTxRx* instance, uint32_t frequency) {
|
||||
// TODO: Remake this function to check if the frequency is allowed on specific module - for modules not based on CC1101
|
||||
furi_assert(instance);
|
||||
UNUSED(frequency);
|
||||
/*
|
||||
furi_assert(instance->txrx_state != SubGhzTxRxStateSleep);
|
||||
|
||||
subghz_devices_idle(instance->radio_device);
|
||||
@@ -645,6 +648,8 @@ bool subghz_txrx_radio_device_is_tx_alowed(SubGhzTxRx* instance, uint32_t freque
|
||||
subghz_devices_idle(instance->radio_device);
|
||||
|
||||
return ret;
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
||||
void subghz_txrx_set_debug_pin_state(SubGhzTxRx* instance, bool state) {
|
||||
|
||||
@@ -334,9 +334,9 @@ const char* subghz_txrx_radio_device_get_name(SubGhzTxRx* instance);
|
||||
* @param instance Pointer to a SubGhzTxRx
|
||||
* @return bool True if the frequency is valid
|
||||
*/
|
||||
bool subghz_txrx_radio_device_is_frequecy_valid(SubGhzTxRx* instance, uint32_t frequency);
|
||||
bool subghz_txrx_radio_device_is_frequency_valid(SubGhzTxRx* instance, uint32_t frequency);
|
||||
|
||||
bool subghz_txrx_radio_device_is_tx_alowed(SubGhzTxRx* instance, uint32_t frequency);
|
||||
bool subghz_txrx_radio_device_is_tx_allowed(SubGhzTxRx* instance, uint32_t frequency);
|
||||
|
||||
void subghz_txrx_set_debug_pin_state(SubGhzTxRx* instance, bool state);
|
||||
bool subghz_txrx_get_debug_pin_state(SubGhzTxRx* instance);
|
||||
|
||||
@@ -115,14 +115,15 @@ bool subghz_key_load(SubGhz* subghz, const char* file_path, bool show_dialog) {
|
||||
break;
|
||||
}
|
||||
|
||||
if(!subghz_txrx_radio_device_is_frequecy_valid(subghz->txrx, temp_data32)) {
|
||||
if(!subghz_txrx_radio_device_is_frequency_valid(subghz->txrx, temp_data32)) {
|
||||
FURI_LOG_E(TAG, "Frequency not supported on chosen radio module");
|
||||
load_key_state = SubGhzLoadKeyStateUnsuportedFreq;
|
||||
break;
|
||||
}
|
||||
|
||||
if(!subghz_txrx_radio_device_is_tx_alowed(subghz->txrx, temp_data32)) {
|
||||
FURI_LOG_E(TAG, "This frequency can only be used for RX on chosen radio module");
|
||||
// TODO: use different frequency allowed lists for differnet modules (non cc1101)
|
||||
if(!furi_hal_subghz_is_tx_allowed(temp_data32)) {
|
||||
FURI_LOG_E(TAG, "This frequency can only be used for RX");
|
||||
load_key_state = SubGhzLoadKeyStateOnlyRx;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ bool subghz_frequency_analyzer_input(InputEvent* event, void* context) {
|
||||
uint32_t frequency_candidate = model->history_frequency[model->selected_index];
|
||||
if(frequency_candidate == 0 ||
|
||||
// !furi_hal_subghz_is_frequency_valid(frequency_candidate) ||
|
||||
!subghz_txrx_radio_device_is_frequecy_valid(
|
||||
!subghz_txrx_radio_device_is_frequency_valid(
|
||||
instance->txrx, frequency_candidate) ||
|
||||
prev_freq_to_save == frequency_candidate) {
|
||||
frequency_candidate = 0;
|
||||
@@ -339,7 +339,7 @@ bool subghz_frequency_analyzer_input(InputEvent* event, void* context) {
|
||||
uint32_t frequency_candidate = subghz_frequency_find_correct(model->frequency);
|
||||
if(frequency_candidate == 0 ||
|
||||
// !furi_hal_subghz_is_frequency_valid(frequency_candidate) ||
|
||||
!subghz_txrx_radio_device_is_frequecy_valid(
|
||||
!subghz_txrx_radio_device_is_frequency_valid(
|
||||
instance->txrx, frequency_candidate) ||
|
||||
prev_freq_to_save == frequency_candidate) {
|
||||
frequency_candidate = 0;
|
||||
@@ -356,7 +356,7 @@ bool subghz_frequency_analyzer_input(InputEvent* event, void* context) {
|
||||
uint32_t frequency_candidate = subghz_frequency_find_correct(model->frequency);
|
||||
if(frequency_candidate == 0 ||
|
||||
// !furi_hal_subghz_is_frequency_valid(frequency_candidate) ||
|
||||
!subghz_txrx_radio_device_is_frequecy_valid(
|
||||
!subghz_txrx_radio_device_is_frequency_valid(
|
||||
instance->txrx, frequency_candidate) ||
|
||||
prev_freq_to_save == frequency_candidate) {
|
||||
frequency_candidate = 0;
|
||||
|
||||
@@ -84,7 +84,7 @@ SubRemLoadSubState subrem_sub_preset_load(
|
||||
if(!flipper_format_read_uint32(fff_data_file, "Frequency", &temp_data32, 1)) {
|
||||
FURI_LOG_W(TAG, "Cannot read frequency. Set default frequency");
|
||||
sub_preset->freq_preset.frequency = subghz_setting_get_default_frequency(setting);
|
||||
} else if(!subghz_txrx_radio_device_is_frequecy_valid(txrx, temp_data32)) {
|
||||
} else if(!subghz_txrx_radio_device_is_frequency_valid(txrx, temp_data32)) {
|
||||
FURI_LOG_E(TAG, "Frequency not supported on chosen radio module");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -629,12 +629,12 @@ const char* subghz_txrx_radio_device_get_name(SubGhzTxRx* instance) {
|
||||
return subghz_devices_get_name(instance->radio_device);
|
||||
}
|
||||
|
||||
bool subghz_txrx_radio_device_is_frequecy_valid(SubGhzTxRx* instance, uint32_t frequency) {
|
||||
bool subghz_txrx_radio_device_is_frequency_valid(SubGhzTxRx* instance, uint32_t frequency) {
|
||||
furi_assert(instance);
|
||||
return subghz_devices_is_frequency_valid(instance->radio_device, frequency);
|
||||
}
|
||||
|
||||
bool subghz_txrx_radio_device_is_tx_alowed(SubGhzTxRx* instance, uint32_t frequency) {
|
||||
bool subghz_txrx_radio_device_is_tx_allowed(SubGhzTxRx* instance, uint32_t frequency) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->txrx_state != SubGhzTxRxStateSleep);
|
||||
|
||||
|
||||
@@ -363,9 +363,9 @@ const char* subghz_txrx_radio_device_get_name(SubGhzTxRx* instance);
|
||||
* @param instance Pointer to a SubGhzTxRx
|
||||
* @return bool True if the frequency is valid
|
||||
*/
|
||||
bool subghz_txrx_radio_device_is_frequecy_valid(SubGhzTxRx* instance, uint32_t frequency);
|
||||
bool subghz_txrx_radio_device_is_frequency_valid(SubGhzTxRx* instance, uint32_t frequency);
|
||||
|
||||
bool subghz_txrx_radio_device_is_tx_alowed(SubGhzTxRx* instance, uint32_t frequency);
|
||||
bool subghz_txrx_radio_device_is_tx_allowed(SubGhzTxRx* instance, uint32_t frequency);
|
||||
|
||||
void subghz_txrx_set_debug_pin_state(SubGhzTxRx* instance, bool state);
|
||||
bool subghz_txrx_get_debug_pin_state(SubGhzTxRx* instance);
|
||||
|
||||
Reference in New Issue
Block a user