save and recall stepsize

This commit is contained in:
formtapez 2023-01-20 22:21:59 +01:00
parent 2d9090862b
commit a8885282cd
No known key found for this signature in database
GPG Key ID: F48A97AFEF29488D
2 changed files with 3 additions and 0 deletions

View File

@ -51,6 +51,7 @@ int app_settings::load(std::string application, AppSettings* settings) {
settings->tx_amp=std::app_settings::read_long_long(file_content, "tx_amp="); settings->tx_amp=std::app_settings::read_long_long(file_content, "tx_amp=");
settings->tx_frequency=std::app_settings::read_long_long(file_content, "tx_frequency="); settings->tx_frequency=std::app_settings::read_long_long(file_content, "tx_frequency=");
settings->tx_gain=std::app_settings::read_long_long(file_content, "tx_gain="); settings->tx_gain=std::app_settings::read_long_long(file_content, "tx_gain=");
settings->step=std::app_settings::read_long_long(file_content, "step=");
rc = SETTINGS_OK; rc = SETTINGS_OK;
} }
else rc = SETTINGS_UNABLE_TO_LOAD; else rc = SETTINGS_UNABLE_TO_LOAD;
@ -79,6 +80,7 @@ int app_settings::save(std::string application, AppSettings* settings) {
// Save other settings from struct // Save other settings from struct
settings_file.write_line("rx_frequency="+to_string_dec_uint(settings->rx_frequency)); settings_file.write_line("rx_frequency="+to_string_dec_uint(settings->rx_frequency));
settings_file.write_line("tx_frequency="+to_string_dec_uint(settings->tx_frequency)); settings_file.write_line("tx_frequency="+to_string_dec_uint(settings->tx_frequency));
settings_file.write_line("step="+to_string_dec_uint(settings->step));
rc = SETTINGS_OK; rc = SETTINGS_OK;
} }

View File

@ -59,6 +59,7 @@ public:
uint32_t tx_frequency; uint32_t tx_frequency;
uint8_t tx_gain; uint8_t tx_gain;
uint8_t vga; uint8_t vga;
uint32_t step;
}; };
int load(std::string application, AppSettings* settings); int load(std::string application, AppSettings* settings);