mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-10-16 13:00:00 +00: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:
@@ -66,6 +66,15 @@ AFSKRxView::AFSKRxView(NavigationView& nav) {
|
||||
&console
|
||||
});
|
||||
|
||||
// load app settings
|
||||
auto rc = settings.load("rx_afsk", &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);
|
||||
}
|
||||
|
||||
|
||||
// DEBUG
|
||||
record_view.on_error = [&nav](std::string message) {
|
||||
nav.display_modal("Error", message);
|
||||
@@ -164,6 +173,11 @@ void AFSKRxView::on_data(uint32_t value, bool is_data) {
|
||||
}
|
||||
|
||||
AFSKRxView::~AFSKRxView() {
|
||||
|
||||
// save app settings
|
||||
app_settings.rx_frequency = field_frequency.value();
|
||||
settings.save("rx_afsk", &app_settings);
|
||||
|
||||
audio::output::stop();
|
||||
receiver_model.disable();
|
||||
baseband::shutdown();
|
||||
|
Reference in New Issue
Block a user