mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-26 23:05:05 +03:00
subghz update hopping config text
by Willy-JL
This commit is contained in:
parent
3d46a62f71
commit
69c780fddb
@ -52,17 +52,17 @@ const float raw_threshold_rssi_value[RAW_THRESHOLD_RSSI_COUNT] = {
|
||||
#define HOPPING_MODE_COUNT 12
|
||||
const char* const hopping_mode_text[HOPPING_MODE_COUNT] = {
|
||||
"OFF",
|
||||
"-90.0",
|
||||
"-85.0",
|
||||
"-80.0",
|
||||
"-75.0",
|
||||
"-70.0",
|
||||
"-65.0",
|
||||
"-60.0",
|
||||
"-55.0",
|
||||
"-50.0",
|
||||
"-45.0",
|
||||
"-40.0",
|
||||
"-90dBm",
|
||||
"-85dBm",
|
||||
"-80dBm",
|
||||
"-75dBm",
|
||||
"-70dBm",
|
||||
"-65dBm",
|
||||
"-60dBm",
|
||||
"-55dBm",
|
||||
"-50dBm",
|
||||
"-45dBm",
|
||||
"-40dBm",
|
||||
|
||||
};
|
||||
const float hopping_mode_value[HOPPING_MODE_COUNT] = {
|
||||
@ -251,10 +251,13 @@ static void subghz_scene_receiver_config_set_hopping(VariableItem* item) {
|
||||
preset.data_size);
|
||||
variable_item_set_current_value_index(
|
||||
frequency_item, subghz_setting_get_frequency_default_index(setting));
|
||||
variable_item_set_item_label(item, "Hopping");
|
||||
} else {
|
||||
variable_item_set_current_value_text(frequency_item, " -----");
|
||||
variable_item_set_current_value_index(
|
||||
frequency_item, subghz_setting_get_frequency_default_index(setting));
|
||||
|
||||
variable_item_set_item_label(item, "Hopping RSSI");
|
||||
}
|
||||
subghz->last_settings->enable_hopping = index != 0;
|
||||
subghz->last_settings->hopping_threshold = hopping_mode_value[index];
|
||||
@ -414,13 +417,13 @@ void subghz_scene_receiver_config_on_enter(void* context) {
|
||||
if(scene_manager_get_scene_state(subghz->scene_manager, SubGhzSceneReadRAW) !=
|
||||
SubGhzCustomEventManagerSet) {
|
||||
// Hopping
|
||||
value_index = subghz_scene_receiver_config_hopper_value_index(subghz);
|
||||
item = variable_item_list_add(
|
||||
subghz->variable_item_list,
|
||||
"Hopping",
|
||||
value_index ? "Hopping RSSI" : "Hopping",
|
||||
HOPPING_MODE_COUNT,
|
||||
subghz_scene_receiver_config_set_hopping,
|
||||
subghz);
|
||||
value_index = subghz_scene_receiver_config_hopper_value_index(subghz);
|
||||
|
||||
variable_item_set_current_value_index(item, value_index);
|
||||
variable_item_set_current_value_text(item, hopping_mode_text[value_index]);
|
||||
|
@ -544,6 +544,12 @@ void variable_item_set_values_count(VariableItem* item, uint8_t values_count) {
|
||||
item->values_count = values_count;
|
||||
}
|
||||
|
||||
void variable_item_set_item_label(VariableItem* item, const char* label) {
|
||||
furi_check(item);
|
||||
furi_check(label);
|
||||
item->label = label;
|
||||
}
|
||||
|
||||
void variable_item_set_current_value_text(VariableItem* item, const char* current_value_text) {
|
||||
furi_check(item);
|
||||
furi_string_set(item->current_value_text, current_value_text);
|
||||
|
@ -97,6 +97,13 @@ void variable_item_set_current_value_index(VariableItem* item, uint8_t current_v
|
||||
*/
|
||||
void variable_item_set_values_count(VariableItem* item, uint8_t values_count);
|
||||
|
||||
/** Set new label for item
|
||||
*
|
||||
* @param item VariableItem* instance
|
||||
* @param label The new label text
|
||||
*/
|
||||
void variable_item_set_item_label(VariableItem* item, const char* label);
|
||||
|
||||
/** Set item current selected text
|
||||
*
|
||||
* @param item VariableItem* instance
|
||||
|
@ -773,8 +773,8 @@ Function,+,bt_keys_storage_set_default_path,void,Bt*
|
||||
Function,+,bt_keys_storage_set_file_path,void,"BtKeysStorage*, const char*"
|
||||
Function,+,bt_keys_storage_set_ram_params,void,"BtKeysStorage*, uint8_t*, uint16_t"
|
||||
Function,+,bt_keys_storage_set_storage_path,void,"Bt*, const char*"
|
||||
Function,-,bt_open_rpc_connection,void,Bt*
|
||||
Function,+,bt_keys_storage_update,_Bool,"BtKeysStorage*, uint8_t*, uint32_t"
|
||||
Function,-,bt_open_rpc_connection,void,Bt*
|
||||
Function,+,bt_profile_restore_default,_Bool,Bt*
|
||||
Function,+,bt_profile_start,FuriHalBleProfileBase*,"Bt*, const FuriHalBleProfileTemplate*, FuriHalBleProfileParams"
|
||||
Function,+,bt_remote_rssi,_Bool,"Bt*, uint8_t*"
|
||||
@ -3610,6 +3610,7 @@ Function,+,variable_item_list_set_enter_callback,void,"VariableItemList*, Variab
|
||||
Function,+,variable_item_list_set_selected_item,void,"VariableItemList*, uint8_t"
|
||||
Function,+,variable_item_set_current_value_index,void,"VariableItem*, uint8_t"
|
||||
Function,+,variable_item_set_current_value_text,void,"VariableItem*, const char*"
|
||||
Function,+,variable_item_set_item_label,void,"VariableItem*, const char*"
|
||||
Function,+,variable_item_set_locked,void,"VariableItem*, _Bool, const char*"
|
||||
Function,+,variable_item_set_values_count,void,"VariableItem*, uint8_t"
|
||||
Function,+,varint_int32_length,size_t,int32_t
|
||||
|
|
Loading…
Reference in New Issue
Block a user