mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-13 03:34:35 +00:00
CPLD: Extract decision about which CPLD config to use.
...based on hardware revision.
This commit is contained in:
parent
a3483a8394
commit
fe687b93a2
@ -134,6 +134,13 @@ static PortaPackModel portapack_model() {
|
|||||||
return model.value();
|
return model.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const portapack::cpld::Config& portapack_cpld_config() {
|
||||||
|
return (portapack_model() == PortaPackModel::R2_20170522)
|
||||||
|
? portapack::cpld::rev_20170522::config
|
||||||
|
: portapack::cpld::rev_20150901::config
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
void init() {
|
void init() {
|
||||||
for(const auto& pin : pins) {
|
for(const auto& pin : pins) {
|
||||||
pin.init();
|
pin.init();
|
||||||
@ -175,15 +182,9 @@ void init() {
|
|||||||
clock_manager.set_reference_ppb(persistent_memory::correction_ppb());
|
clock_manager.set_reference_ppb(persistent_memory::correction_ppb());
|
||||||
clock_manager.run_at_full_speed();
|
clock_manager.run_at_full_speed();
|
||||||
|
|
||||||
if( portapack_model() == PortaPackModel::R2_20170522 ) {
|
if( !cpld_update_if_necessary(portapack_cpld_config()) ) {
|
||||||
if( !cpld_update_if_necessary(portapack::cpld::rev_20170522::config) ) {
|
|
||||||
chSysHalt();
|
chSysHalt();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if( !cpld_update_if_necessary(portapack::cpld::rev_20150901::config) ) {
|
|
||||||
chSysHalt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !cpld_hackrf_load_sram() ) {
|
if( !cpld_hackrf_load_sram() ) {
|
||||||
chSysHalt();
|
chSysHalt();
|
||||||
|
Loading…
Reference in New Issue
Block a user