diff --git a/ion/src/device/boot/rt0.cpp b/ion/src/device/boot/rt0.cpp index 4a018ea55..c1d6212d6 100644 --- a/ion/src/device/boot/rt0.cpp +++ b/ion/src/device/boot/rt0.cpp @@ -6,7 +6,6 @@ extern "C" { #include #include "../device.h" #include "../console.h" -#include "../bench/bench.h" typedef void (*cxx_constructor)(); @@ -62,14 +61,6 @@ void start() { Ion::Device::init(); - if (Ion::Console::Device::peerConnected()) { - /*Ion::Keyboard::State state = Ion::Keyboard::scan(); - if (Ion::Keyboard::keyDown(Ion::Keyboard::Key::A1, state) && - Ion::Keyboard::keyDown(Ion::Keyboard::Key::I5, state)) { - */ - Ion::Device::Bench::run(); - } - ion_app(); abort(); diff --git a/ion/src/device/device.cpp b/ion/src/device/device.cpp index 6c0376648..63048c55e 100644 --- a/ion/src/device/device.cpp +++ b/ion/src/device/device.cpp @@ -13,6 +13,7 @@ extern "C" { #include "console.h" #include "swd.h" #include "usb.h" +#include "bench/bench.h" #define USE_SD_CARD 0 @@ -111,7 +112,13 @@ void init() { GPIO(g).PUPDR()->set(0x00000000); // All to "None" } + bool consolePeerConnectedOnBoot = Ion::Console::Device::peerConnected(); + initPeripherals(); + + if (consolePeerConnectedOnBoot) { + Ion::Device::Bench::run(); + } } void shutdown() {