diff --git a/firmware/application/main.cpp b/firmware/application/main.cpp index 3bea477e..05ce816e 100755 --- a/firmware/application/main.cpp +++ b/firmware/application/main.cpp @@ -24,8 +24,6 @@ #include "portapack.hpp" #include "portapack_shared_memory.hpp" -#include "cpld_update.hpp" - #include "message_queue.hpp" #include "ui.hpp" @@ -72,14 +70,6 @@ static void event_loop() { int main(void) { portapack::init(); - if( !cpld_update_if_necessary() ) { - chSysHalt(); - } - - if( !cpld_hackrf_load_sram() ) { - chSysHalt(); - } - portapack::io.init(); portapack::display.init(); diff --git a/firmware/application/portapack.cpp b/firmware/application/portapack.cpp index 0aabc219..344f0aa8 100644 --- a/firmware/application/portapack.cpp +++ b/firmware/application/portapack.cpp @@ -32,6 +32,8 @@ using namespace hackrf::one; #include "touch_adc.hpp" #include "audio.hpp" +#include "cpld_update.hpp" + namespace portapack { portapack::IO io { @@ -149,6 +151,14 @@ void init() { radio::init(); touch::adc::init(); + + if( !cpld_update_if_necessary() ) { + chSysHalt(); + } + + if( !cpld_hackrf_load_sram() ) { + chSysHalt(); + } } void shutdown() {