mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-21 05:04:46 -07:00
Merge branch 'UNLEASHED' into 420
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
#include <lib/toolbox/path.h>
|
||||
#include "subghz_i.h"
|
||||
|
||||
#define TAG "SubGhzApp"
|
||||
|
||||
bool subghz_custom_event_callback(void* context, uint32_t event) {
|
||||
furi_assert(context);
|
||||
SubGhz* subghz = context;
|
||||
@@ -174,13 +176,30 @@ SubGhz* subghz_alloc() {
|
||||
subghz->setting = subghz_setting_alloc();
|
||||
subghz_setting_load(subghz->setting, EXT_PATH("subghz/assets/setting_user.txt"));
|
||||
|
||||
// Load last used values for Read, Read RAW, etc. or default
|
||||
subghz->last_settings = subghz_last_settings_alloc();
|
||||
subghz_last_settings_load(
|
||||
subghz->last_settings, subghz_setting_get_preset_count(subghz->setting));
|
||||
#if FURI_DEBUG
|
||||
FURI_LOG_D(
|
||||
TAG,
|
||||
"last frequency: %d, preset: %d",
|
||||
subghz->last_settings->frequency,
|
||||
subghz->last_settings->preset);
|
||||
#endif
|
||||
subghz_setting_set_default_frequency(subghz->setting, subghz->last_settings->frequency);
|
||||
|
||||
//init Worker & Protocol & History & KeyBoard
|
||||
subghz->lock = SubGhzLockOff;
|
||||
subghz->txrx = malloc(sizeof(SubGhzTxRx));
|
||||
subghz->txrx->preset = malloc(sizeof(SubGhzPresetDefinition));
|
||||
string_init(subghz->txrx->preset->name);
|
||||
subghz_preset_init(
|
||||
subghz, "AM650", subghz_setting_get_default_frequency(subghz->setting), NULL, 0);
|
||||
subghz,
|
||||
subghz_setting_get_preset_name(subghz->setting, subghz->last_settings->preset),
|
||||
subghz->last_settings->frequency,
|
||||
NULL,
|
||||
0);
|
||||
|
||||
subghz->txrx->txrx_state = SubGhzTxRxStateSleep;
|
||||
subghz->txrx->hopper_state = SubGhzHopperStateOFF;
|
||||
@@ -287,6 +306,7 @@ void subghz_free(SubGhz* subghz) {
|
||||
|
||||
//setting
|
||||
subghz_setting_free(subghz->setting);
|
||||
subghz_last_settings_free(subghz->last_settings);
|
||||
|
||||
//Worker & Protocol & History
|
||||
subghz_receiver_free(subghz->txrx->receiver);
|
||||
|
||||
Reference in New Issue
Block a user