mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-21 21:34:33 -04:00
Save individual app settings. Currently only for apps in Receive section and basic settings like, LNA, VGA, Rx Amp and Frequency.
This commit is contained in:
parent
dccc68a4e0
commit
799a473b36
31 changed files with 541 additions and 90 deletions
|
@ -151,6 +151,16 @@ TPMSAppView::TPMSAppView(NavigationView&) {
|
|||
&options_type,
|
||||
});
|
||||
|
||||
// load app settings
|
||||
auto rc = settings.load("rx_tpms", &app_settings);
|
||||
if(rc == SETTINGS_OK) {
|
||||
field_lna.set_value(app_settings.lna);
|
||||
field_vga.set_value(app_settings.vga);
|
||||
field_rf_amp.set_value(app_settings.rx_amp);
|
||||
options_band.set_by_value(app_settings.rx_frequency);
|
||||
}
|
||||
else options_band.set_by_value(receiver_model.tuning_frequency());
|
||||
|
||||
radio::enable({
|
||||
tuning_frequency(),
|
||||
sampling_rate,
|
||||
|
@ -184,6 +194,12 @@ TPMSAppView::TPMSAppView(NavigationView&) {
|
|||
}
|
||||
|
||||
TPMSAppView::~TPMSAppView() {
|
||||
|
||||
|
||||
// save app settings
|
||||
app_settings.rx_frequency = target_frequency_;
|
||||
settings.save("rx_tpms", &app_settings);
|
||||
|
||||
radio::disable();
|
||||
|
||||
baseband::shutdown();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue