mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-29 17:17:28 -04:00
removed need for cpld mode setup for QFP100
This commit is contained in:
parent
9b263def37
commit
75718c79b9
3 changed files with 52 additions and 13 deletions
|
@ -489,12 +489,20 @@ bool init() {
|
|||
|
||||
chThdSleepMilliseconds(10);
|
||||
|
||||
if( !portapack::cpld::update_if_necessary(portapack_cpld_config()) ) {
|
||||
chThdSleepMilliseconds(10);
|
||||
// If using a "2021/12 QFP100", press and hold the left button while booting. Should only need to do once.
|
||||
if (load_config() != 3 && load_config() != 4){
|
||||
shutdown_base();
|
||||
return false;
|
||||
auto pp_config = portapack_cpld_config();
|
||||
auto cpld_update_possible = portapack::cpld::update_possible(); //QFP100 CPLD fails this check. skip CPLD update
|
||||
auto cpld_update_necessary = cpld_update_possible && portapack::cpld::update_necessary(pp_config);
|
||||
if ( cpld_update_necessary ) {
|
||||
auto ok = portapack::cpld::update(pp_config);
|
||||
|
||||
if( !ok ) {
|
||||
chThdSleepMilliseconds(10);
|
||||
// Mode left (R1) and right (R2,H2,H2+) bypass going into hackrf mode after failing CPLD update
|
||||
// Mode center (autodetect), up (R1) and down (R2,H2,H2) will go into hackrf mode after failing CPLD update
|
||||
if (load_config() != 3 /* left */ && load_config() != 4 /* right */){
|
||||
shutdown_base();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue