Pmem reset (#1115)

* reset config when holding down select durring boot

it still need to be tripple checked if adc or control init really doesnt use any pmem

* one less magic number :)

* dual key action left+right for pmem reset

---------

Co-authored-by: Eisenberger Tamas <e.tamas@iwstudio.hu>
This commit is contained in:
E.T 2023-06-08 00:52:29 +02:00 committed by GitHub
parent d3a7414e51
commit 3ddc753c88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 18 deletions

View file

@ -39,6 +39,8 @@
#include <fstream>
#include "file.hpp"
#include "irq_controls.hpp"
using namespace std;
namespace portapack {
@ -445,7 +447,8 @@ void defaults() {
}
void init() {
if (backup_ram->is_valid()) {
const auto switches_state = get_switches_state();
if (!(switches_state[(size_t)ui::KeyEvent::Left] && switches_state[(size_t)ui::KeyEvent::Right]) && backup_ram->is_valid()) {
// Copy valid persistent data into cache.
cached_backup_ram = *backup_ram;