From a56a2a060e8b91fe5e61d9f7f3f4e6f389bce1c2 Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Wed, 25 Jan 2017 11:04:29 +0100 Subject: [PATCH] [ion] Share the Ion::Power::suspend stub Change-Id: I6a278547a5b5d5caec796ad53e88bca706cbcad3 --- apps/apps_container.cpp | 4 ++++ ion/src/device/Makefile | 7 ++++++- ion/src/emscripten/Makefile | 8 +++++--- ion/src/shared/Makefile | 4 ---- ion/src/shared/power.cpp | 4 ++++ ion/src/simulator/Makefile | 12 +++++++----- 6 files changed, 26 insertions(+), 13 deletions(-) delete mode 100644 ion/src/shared/Makefile create mode 100644 ion/src/shared/power.cpp diff --git a/apps/apps_container.cpp b/apps/apps_container.cpp index 51f843831..c4032c0a5 100644 --- a/apps/apps_container.cpp +++ b/apps/apps_container.cpp @@ -1,4 +1,5 @@ #include "apps_container.h" +#include extern "C" { #include } @@ -51,5 +52,8 @@ bool AppsContainer::handleEvent(Ion::Events::Event event) { switchTo(appAtIndex(0)); return true; } + if (event == Ion::Events::OnOff) { + Ion::Power::suspend(); + } return false; } diff --git a/ion/src/device/Makefile b/ion/src/device/Makefile index 49aae4355..d6b5df1b8 100644 --- a/ion/src/device/Makefile +++ b/ion/src/device/Makefile @@ -1,5 +1,5 @@ -include ion/src/shared/Makefile include ion/src/device/boot/Makefile + objs += $(addprefix ion/src/device/, \ backlight.o \ battery.o\ @@ -11,6 +11,11 @@ objs += $(addprefix ion/src/device/, \ sd_card.o\ ) +objs += $(addprefix ion/src/shared/, \ + events.o \ + events_from_keyboard.o \ +) + # When using the register.h C++ file in production mode, we expect the compiler # to completely inline all bit manipulations. For some reason, if we build using # the -Os optimization flag, GCC doesn't inline everything and and ends up diff --git a/ion/src/emscripten/Makefile b/ion/src/emscripten/Makefile index 0b4f00d97..d8787d2c3 100644 --- a/ion/src/emscripten/Makefile +++ b/ion/src/emscripten/Makefile @@ -1,7 +1,9 @@ -#include ion/src/shared/Makefile - objs += $(addprefix ion/src/emscripten/, \ main.o\ ) -objs += ion/src/shared/events.o +objs += $(addprefix ion/src/shared/, \ + crc32.o \ + events.o \ + power.o \ +) diff --git a/ion/src/shared/Makefile b/ion/src/shared/Makefile deleted file mode 100644 index 033222a7d..000000000 --- a/ion/src/shared/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -objs += $(addprefix ion/src/shared/,\ - events.o\ - events_from_keyboard.o\ -) diff --git a/ion/src/shared/power.cpp b/ion/src/shared/power.cpp new file mode 100644 index 000000000..d9848635c --- /dev/null +++ b/ion/src/shared/power.cpp @@ -0,0 +1,4 @@ +#include + +void Ion::Power::suspend() { +} diff --git a/ion/src/simulator/Makefile b/ion/src/simulator/Makefile index 964468a1d..5091f72c7 100644 --- a/ion/src/simulator/Makefile +++ b/ion/src/simulator/Makefile @@ -1,16 +1,18 @@ -include ion/src/shared/Makefile - objs += $(addprefix ion/src/simulator/, \ battery.o\ init.o\ ) -objs += $(addprefix ion/src/shared/, \ - crc32.o\ -) objs += $(addprefix ion/src/simulator/boot/, main.o) objs += $(addprefix ion/src/simulator/display/, fltklcd.o) objs += $(addprefix ion/src/simulator/keyboard/, fltkkbd.o) +objs += $(addprefix ion/src/shared/, \ + crc32.o \ + events.o \ + events_from_keyboard.o \ + power.o \ +) + SFLAGS += `fltk-config --cflags` LDFLAGS += `fltk-config --ldflags`