mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-13 08:55:39 -04:00
Added persistent memory of save state
This commit is contained in:
parent
50821bab55
commit
0c0d47b0d2
3 changed files with 30 additions and 7 deletions
|
@ -203,19 +203,28 @@ static audio::Codec* portapack_audio_codec() {
|
|||
}
|
||||
|
||||
static const portapack::cpld::Config& portapack_cpld_config() {
|
||||
|
||||
const auto switches_state = get_switches_state();
|
||||
if (switches_state[(size_t)ui::KeyEvent::Up]){
|
||||
return portapack::cpld::rev_20150901::config;
|
||||
}
|
||||
if (switches_state[(size_t)ui::KeyEvent::Down]){
|
||||
persistent_memory::set_config_cpld(1);
|
||||
return portapack::cpld::rev_20170522::config;
|
||||
}
|
||||
if (switches_state[(size_t)ui::KeyEvent::Down]){
|
||||
persistent_memory::set_config_cpld(2);
|
||||
return portapack::cpld::rev_20150901::config;
|
||||
}
|
||||
if (switches_state[(size_t)ui::KeyEvent::Select]){
|
||||
persistent_memory::set_config_cpld(0);
|
||||
}
|
||||
|
||||
|
||||
if (portapack::persistent_memory::config_cpld() == 1) {
|
||||
return portapack::cpld::rev_20170522::config;
|
||||
} else if (portapack::persistent_memory::config_cpld() == 2) {
|
||||
return portapack::cpld::rev_20150901::config;
|
||||
}
|
||||
return (portapack_model() == PortaPackModel::R2_20170522)
|
||||
? portapack::cpld::rev_20170522::config
|
||||
: portapack::cpld::rev_20150901::config
|
||||
;
|
||||
? portapack::cpld::rev_20170522::config
|
||||
: portapack::cpld::rev_20150901::config;
|
||||
}
|
||||
|
||||
Backlight* backlight() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue