From c709d161afda0381b989baf336c1afe9ad90deda Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Thu, 6 Apr 2017 10:14:59 +0200 Subject: [PATCH] [ion/device] Proper ordering of console init and bench launch Change-Id: Ic43ee84e2b2024a10d6704835736535b3d952f0c --- ion/src/device/boot/rt0.cpp | 9 --------- ion/src/device/device.cpp | 7 +++++++ 2 files changed, 7 insertions(+), 9 deletions(-) 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 8ebbffce0..17ad50261 100644 --- a/ion/src/device/device.cpp +++ b/ion/src/device/device.cpp @@ -12,6 +12,7 @@ extern "C" { #include "backlight.h" #include "console.h" #include "swd.h" +#include "bench/bench.h" #define USE_SD_CARD 0 @@ -110,7 +111,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() {