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`