mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-15 00:08:11 -07:00
SubGhz App: change load custom presets
This commit is contained in:
@@ -482,3 +482,35 @@ uint32_t subghz_setting_get_default_frequency(SubGhzSetting* instance) {
|
||||
return subghz_setting_get_frequency(
|
||||
instance, subghz_setting_get_frequency_default_index(instance));
|
||||
}
|
||||
|
||||
uint8_t subghz_setting_customs_presets_to_log(SubGhzSetting* instance) {
|
||||
furi_assert(instance);
|
||||
#ifndef FURI_DEBUG
|
||||
FURI_LOG_I(TAG, "Logging loaded presets allow only Debug build");
|
||||
#else
|
||||
uint8_t count = 0;
|
||||
FuriString* temp = furi_string_alloc();
|
||||
|
||||
FURI_LOG_I(TAG, "Loaded presets");
|
||||
for
|
||||
M_EACH(item, instance->preset->data, SubGhzSettingCustomPresetItemArray_t) {
|
||||
furi_string_reset(temp);
|
||||
|
||||
for(uint8_t i = 0; i < item->custom_preset_data_size; i++) {
|
||||
furi_string_cat_printf(temp, "%02u ", item->custom_preset_data[i]);
|
||||
}
|
||||
|
||||
FURI_LOG_I(
|
||||
TAG, "%u - %s", count + 1, furi_string_get_cstr(item->custom_preset_name));
|
||||
FURI_LOG_I(TAG, " Size: %u", item->custom_preset_data_size);
|
||||
FURI_LOG_I(TAG, " Data: %s", furi_string_get_cstr(temp));
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
furi_string_free(temp);
|
||||
|
||||
return count;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -53,6 +53,8 @@ uint32_t subghz_setting_get_default_frequency(SubGhzSetting* instance);
|
||||
|
||||
void subghz_setting_set_default_frequency(SubGhzSetting* instance, uint32_t frequency_to_setup);
|
||||
|
||||
uint8_t subghz_setting_customs_presets_to_log(SubGhzSetting* instance);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user