diff --git a/apps/Makefile b/apps/Makefile index 2edbb9ea6..ffbf009c2 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -36,6 +36,8 @@ app_objs += $(addprefix apps/,\ variable_box_leaf_cell.o\ ) +apps/apps_container.o: SFLAGS += -DON_BOARDING=$(ON_BOARDING) + app_images += apps/exam_icon.png # Tracking which source file uses which image is painful. But we need to ensure diff --git a/apps/apps_container.cpp b/apps/apps_container.cpp index 0b17d1777..6d1a3b959 100644 --- a/apps/apps_container.cpp +++ b/apps/apps_container.cpp @@ -6,6 +6,10 @@ extern "C" { #include } +#ifndef ON_BOARDING +#error This file expects ON_BOARDING to be defined +#endif + using namespace Shared; AppsContainer::AppsContainer() : @@ -152,7 +156,11 @@ void AppsContainer::switchTo(App::Snapshot * snapshot) { } void AppsContainer::run() { +#if ON_BOARDING switchTo(onBoardingAppSnapshot()); +#else + switchTo(appSnapshotAtIndex(0)); +#endif Container::run(); switchTo(nullptr); } diff --git a/build/platform.blackbox.mak b/build/platform.blackbox.mak index ed9f74e64..4291ed910 100644 --- a/build/platform.blackbox.mak +++ b/build/platform.blackbox.mak @@ -1,3 +1,4 @@ TOOLCHAIN ?= afl USE_LIBA ?= 0 EXE = bin +ON_BOARDING ?= 0 diff --git a/build/platform.device.mak b/build/platform.device.mak index 53457e48b..336c64b0e 100644 --- a/build/platform.device.mak +++ b/build/platform.device.mak @@ -5,6 +5,7 @@ TOOLCHAIN = arm-llvm endif USE_LIBA = 1 EXE = elf +ON_BOARDING ?= !DEBUG %_flash: %.bin dfu-util -i 0 -a 0 -s 0x08000000:leave -D $< diff --git a/build/platform.emscripten.mak b/build/platform.emscripten.mak index be4c03822..402edd4ee 100644 --- a/build/platform.emscripten.mak +++ b/build/platform.emscripten.mak @@ -1,3 +1,4 @@ TOOLCHAIN = emscripten USE_LIBA = 0 EXE = html +ON_BOARDING ?= 0 diff --git a/build/platform.simulator.mak b/build/platform.simulator.mak index ad21bb801..464435146 100644 --- a/build/platform.simulator.mak +++ b/build/platform.simulator.mak @@ -1,3 +1,4 @@ TOOLCHAIN ?= host-clang USE_LIBA = 0 EXE = elf +ON_BOARDING ?= 0