Added Recon app persistent settings

This commit is contained in:
GullCode 2022-09-11 16:10:51 +02:00
parent 9d59c07855
commit 9086f32a63
2 changed files with 80 additions and 1 deletions

View File

@ -285,6 +285,9 @@ struct data_t {
// Hardware // Hardware
uint32_t hardware_config; uint32_t hardware_config;
// Recon App
uint64_t recon_config;
constexpr data_t() : constexpr data_t() :
structure_version(data_structure_version_enum::VERSION_CURRENT), structure_version(data_structure_version_enum::VERSION_CURRENT),
tuned_frequency(tuned_frequency_reset_value), tuned_frequency(tuned_frequency_reset_value),
@ -311,7 +314,8 @@ struct data_t {
tone_mix(tone_mix_reset_value), tone_mix(tone_mix_reset_value),
hardware_config(0) hardware_config(0),
recon_config(0)
{ {
} }
}; };
@ -663,6 +667,61 @@ void set_clkout_freq(uint32_t freq) {
data->ui_config.set_clkout_freq(freq); data->ui_config.set_clkout_freq(freq);
} }
bool recon_autosave_freqs() {
return (data->recon_config & 0x80000000UL) ? true : false;
}
bool recon_autostart_recon() {
return (data->recon_config & 0x40000000UL) ? true : false;
}
bool recon_continuous() {
return (data->recon_config & 0x20000000UL) ? true : false;
}
bool recon_clear_output() {
return (data->recon_config & 0x10000000UL) ? true : false;
}
bool recon_load_freqs() {
return (data->recon_config & 0x08000000UL) ? true : false;
}
bool recon_load_ranges() {
return (data->recon_config & 0x04000000UL) ? true : false;
}
bool recon_update_ranges_when_recon() {
return (data->recon_config & 0x02000000UL) ? true : false;
}
bool recon_load_hamradios() {
return (data->recon_config & 0x01000000UL) ? true : false;
}
bool recon_match_mode() {
return (data->recon_config & 0x00800000UL) ? true : false;
}
void set_recon_autosave_freqs(const bool v ){
data->recon_config = (data->recon_config & ~0x80000000UL) | (v << 31);
}
void set_recon_autostart_recon(const bool v ){
data->recon_config = (data->recon_config & ~0x40000000UL) | (v << 30);
}
void set_recon_continuous(const bool v ){
data->recon_config = (data->recon_config & ~0x20000000UL) | (v << 29);
}
void set_recon_clear_output(const bool v ){
data->recon_config = (data->recon_config & ~0x10000000UL) | (v << 28);
}
void set_recon_load_freqs(const bool v ){
data->recon_config = (data->recon_config & ~0x08000000UL) | (v << 27);
}
void set_recon_load_ranges(const bool v ){
data->recon_config = (data->recon_config & ~0x04000000UL) | (v << 26);
}
void set_recon_update_ranges_when_recon(const bool v ){
data->recon_config = (data->recon_config & ~0x02000000UL) | (v << 25);
}
void set_recon_load_hamradios(const bool v ){
data->recon_config = (data->recon_config & ~0x01000000UL) | (v << 24);
}
void set_recon_match_mode(const bool v ) {
data->recon_config = (data->recon_config & ~0x00800000UL) | (v << 23);
}
} /* namespace persistent_memory */ } /* namespace persistent_memory */
} /* namespace portapack */ } /* namespace portapack */

View File

@ -188,6 +188,26 @@ void set_clkout_enabled(bool v);
uint32_t clkout_freq(); uint32_t clkout_freq();
void set_clkout_freq(uint32_t freq); void set_clkout_freq(uint32_t freq);
/* Recon app */
bool recon_autosave_freqs();
bool recon_autostart_recon();
bool recon_continuous();
bool recon_clear_output();
bool recon_load_freqs();
bool recon_load_ranges();
bool recon_update_ranges_when_recon();
bool recon_load_hamradios();
bool recon_match_mode();
void set_recon_autosave_freqs(const bool v);
void set_recon_autostart_recon(const bool v);
void set_recon_continuous(const bool v);
void set_recon_clear_output(const bool v);
void set_recon_load_freqs(const bool v);
void set_recon_load_ranges(const bool v);
void set_recon_update_ranges_when_recon(const bool v);
void set_recon_load_hamradios(const bool v );
void set_recon_match_mode( const bool v );
} /* namespace persistent_memory */ } /* namespace persistent_memory */
} /* namespace portapack */ } /* namespace portapack */