From a37ba1ee2bdc59d56ac3be86f4fdc50641f21f0f Mon Sep 17 00:00:00 2001 From: jLynx Date: Thu, 7 Apr 2022 08:41:46 +1200 Subject: [PATCH 1/3] 2021/12 QFP100 fix --- firmware/application/portapack.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/firmware/application/portapack.cpp b/firmware/application/portapack.cpp index 15b9d5c2b..58008b72e 100644 --- a/firmware/application/portapack.cpp +++ b/firmware/application/portapack.cpp @@ -228,6 +228,11 @@ static const portapack::cpld::Config& portapack_cpld_config() { } Backlight* backlight() { + // if (portapack::persistent_memory::config_cpld() == 1) { + // return static_cast(&backlight_cat4004); + // } else if (portapack::persistent_memory::config_cpld() == 2) { + // return static_cast(&backlight_on_off); + // } return (portapack_model() == PortaPackModel::R2_20170522) ? static_cast(&backlight_cat4004) // R2_20170522 : static_cast(&backlight_on_off); // R1_20150901 @@ -415,8 +420,12 @@ bool init() { audio::init(portapack_audio_codec()); if( !portapack::cpld::update_if_necessary(portapack_cpld_config()) ) { - shutdown_base(); - return false; + const auto switches_state = get_switches_state(); + // If using a "2021/12 QFP100", press and hold the left button while booting. Should only need to do once. + if (!switches_state[(size_t)ui::KeyEvent::Left]){ + shutdown_base(); + return false; + } } if( !hackrf::cpld::load_sram() ) { From dd2fdecb2188c48947c9bd979aeb315bcc2b50ee Mon Sep 17 00:00:00 2001 From: jLynx Date: Thu, 7 Apr 2022 08:48:00 +1200 Subject: [PATCH 2/3] removed commented lines --- firmware/application/portapack.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/firmware/application/portapack.cpp b/firmware/application/portapack.cpp index 58008b72e..6c6d0cee8 100644 --- a/firmware/application/portapack.cpp +++ b/firmware/application/portapack.cpp @@ -228,11 +228,6 @@ static const portapack::cpld::Config& portapack_cpld_config() { } Backlight* backlight() { - // if (portapack::persistent_memory::config_cpld() == 1) { - // return static_cast(&backlight_cat4004); - // } else if (portapack::persistent_memory::config_cpld() == 2) { - // return static_cast(&backlight_on_off); - // } return (portapack_model() == PortaPackModel::R2_20170522) ? static_cast(&backlight_cat4004) // R2_20170522 : static_cast(&backlight_on_off); // R1_20150901 From 2d3cb426bad6d259aab2af618c6026bb17a39566 Mon Sep 17 00:00:00 2001 From: jLynx Date: Thu, 7 Apr 2022 09:11:10 +1200 Subject: [PATCH 3/3] Stores in memory --- firmware/application/portapack.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/firmware/application/portapack.cpp b/firmware/application/portapack.cpp index 6c6d0cee8..7ecfb7212 100644 --- a/firmware/application/portapack.cpp +++ b/firmware/application/portapack.cpp @@ -212,6 +212,9 @@ static const portapack::cpld::Config& portapack_cpld_config() { persistent_memory::set_config_cpld(2); return portapack::cpld::rev_20150901::config; } + if (switches_state[(size_t)ui::KeyEvent::Left]){ + persistent_memory::set_config_cpld(3); + } if (switches_state[(size_t)ui::KeyEvent::Select]){ persistent_memory::set_config_cpld(0); } @@ -415,9 +418,8 @@ bool init() { audio::init(portapack_audio_codec()); if( !portapack::cpld::update_if_necessary(portapack_cpld_config()) ) { - const auto switches_state = get_switches_state(); // If using a "2021/12 QFP100", press and hold the left button while booting. Should only need to do once. - if (!switches_state[(size_t)ui::KeyEvent::Left]){ + if (portapack::persistent_memory::config_cpld() != 3){ shutdown_base(); return false; }