From dd8ffaabd57a200efbacf2a174403234603dae36 Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Thu, 16 Mar 2017 14:55:01 +0100 Subject: [PATCH] [ion] Boot on the bench if keys A1 and I5 are pressed after reset Change-Id: I292a3c1061c20ee5834e27dcc93ea2da65f6cabe --- ion/src/device/bench/bench.cpp | 1 + ion/src/device/bench/bench.h | 14 ++++++++++++++ ion/src/device/boot/rt0.cpp | 6 ++++++ 3 files changed, 21 insertions(+) create mode 100644 ion/src/device/bench/bench.h diff --git a/ion/src/device/bench/bench.cpp b/ion/src/device/bench/bench.cpp index 075d5d12c..1ff411c91 100644 --- a/ion/src/device/bench/bench.cpp +++ b/ion/src/device/bench/bench.cpp @@ -1,3 +1,4 @@ +#include "bench.h" #include #include "command_list.h" diff --git a/ion/src/device/bench/bench.h b/ion/src/device/bench/bench.h new file mode 100644 index 000000000..de999cd37 --- /dev/null +++ b/ion/src/device/bench/bench.h @@ -0,0 +1,14 @@ +#ifndef ION_DEVICE_BENCH_BENCH_H +#define ION_DEVICE_BENCH_BENCH_H + +namespace Ion { +namespace Device { +namespace Bench { + +void run(); + +} +} +} + +#endif diff --git a/ion/src/device/boot/rt0.cpp b/ion/src/device/boot/rt0.cpp index 3aae72085..d3631fa63 100644 --- a/ion/src/device/boot/rt0.cpp +++ b/ion/src/device/boot/rt0.cpp @@ -5,6 +5,7 @@ extern "C" { #include #include #include "../device.h" +#include "../bench/bench.h" typedef void (*cxx_constructor)(); @@ -60,6 +61,11 @@ void start() { Ion::Device::init(); + if (Ion::Keyboard::keyDown(Ion::Keyboard::Key::A1) && + Ion::Keyboard::keyDown(Ion::Keyboard::Key::I5)) { + Ion::Device::Bench::run(); + } + ion_app(); abort();