mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[scripts] Remove EPSILON_ONBOARDING_APP flag
This commit is contained in:
7
Makefile
7
Makefile
@@ -31,7 +31,6 @@ endef
|
||||
.PHONY: info
|
||||
info:
|
||||
@echo "EPSILON_VERSION = $(EPSILON_VERSION)"
|
||||
@echo "EPSILON_ONBOARDING_APP = $(EPSILON_ONBOARDING_APP)"
|
||||
@echo "EPSILON_BOOT_PROMPT = $(EPSILON_BOOT_PROMPT)"
|
||||
@echo "EPSILON_APPS = $(EPSILON_APPS)"
|
||||
@echo "EPSILON_I18N = $(EPSILON_I18N)"
|
||||
@@ -82,11 +81,13 @@ all_objs = $(call object_for,$(all_src))
|
||||
# but allows correct yet optimal incremental builds.
|
||||
-include $(all_objs:.o=.d)
|
||||
|
||||
executables = epsilon test
|
||||
executables = epsilon epsilon.on-boarding test
|
||||
|
||||
#define platform generic targets
|
||||
|
||||
$(BUILD_DIR)/epsilon.$(EXE): $(call object_for,$(src) $(ion_device_dfu_relocated_src) $(epsilon_src))
|
||||
$(BUILD_DIR)/epsilon.$(EXE): $(call object_for,$(src) $(epsilon_src) $(ion_device_dfu_relocated_src) $(apps_launch_default_src))
|
||||
|
||||
$(BUILD_DIR)/epsilon.on-boarding.$(EXE): $(call object_for,$(src) $(epsilon_src) $(ion_device_dfu_relocated_src) $(apps_launch_on_boarding_src))
|
||||
|
||||
$(BUILD_DIR)/test.$(EXE): $(BUILD_DIR)/quiz/src/tests_symbols.o $(call object_for,$(src) $(ion_device_dfu_relocated_src) $(tests) $(runner_src))
|
||||
|
||||
|
||||
@@ -30,6 +30,9 @@ app_src += $(addprefix apps/,\
|
||||
variable_box_empty_controller.cpp \
|
||||
)
|
||||
|
||||
apps_launch_on_boarding_src = apps/apps_container_launch_on_boarding.cpp
|
||||
apps_launch_default_src = apps/apps_container_launch_default.cpp
|
||||
|
||||
snapshots_declaration = $(foreach i,$(apps),$(i)::Snapshot m_snapshot$(subst :,,$(i))Snapshot;)
|
||||
apps_declaration = $(foreach i,$(apps),$(i) m_$(subst :,,$(i));)
|
||||
snapshots_construction = $(foreach i,$(apps),,m_snapshot$(subst :,,$(i))Snapshot())
|
||||
@@ -89,7 +92,7 @@ epsilon_src += $(addprefix apps/, \
|
||||
i18n.py \
|
||||
)
|
||||
|
||||
all_app_src = $(app_src) $(epsilon_src)
|
||||
all_app_src = $(app_src) $(epsilon_src) $(apps_launch_on_boarding_src) $(apps_launch_default_src)
|
||||
|
||||
$(call object_for,$(all_app_src)): $(BUILD_DIR)/apps/i18n.h
|
||||
$(call object_for,$(all_app_src)): $(BUILD_DIR)/python/port/genhdr/qstrdefs.generated.h
|
||||
|
||||
@@ -267,12 +267,7 @@ void AppsContainer::run() {
|
||||
/* Normal execution. The exception checkpoint must be created before
|
||||
* switching to the first app, because the first app might create nodes on
|
||||
* the pool. */
|
||||
bool switched =
|
||||
#if EPSILON_ONBOARDING_APP
|
||||
switchTo(onBoardingAppSnapshot());
|
||||
#else
|
||||
switchTo(appSnapshotAtIndex(numberOfApps() == 2 ? 1 : 0));
|
||||
#endif
|
||||
bool switched = switchTo(initialAppSnapshot());
|
||||
assert(switched);
|
||||
(void) switched; // Silence compilation warning about unused variable.
|
||||
} else {
|
||||
|
||||
@@ -29,6 +29,7 @@ public:
|
||||
static bool poincareCircuitBreaker();
|
||||
virtual int numberOfApps() = 0;
|
||||
virtual App::Snapshot * appSnapshotAtIndex(int index) = 0;
|
||||
App::Snapshot * initialAppSnapshot();
|
||||
App::Snapshot * hardwareTestAppSnapshot();
|
||||
App::Snapshot * onBoardingAppSnapshot();
|
||||
App::Snapshot * usbConnectedAppSnapshot();
|
||||
|
||||
7
apps/apps_container_launch_default.cpp
Normal file
7
apps/apps_container_launch_default.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "apps_container.h"
|
||||
|
||||
App::Snapshot * AppsContainer::initialAppSnapshot() {
|
||||
// The backlight has not been initialized
|
||||
Ion::Backlight::init();
|
||||
return appSnapshotAtIndex(numberOfApps() == 2 ? 1 : 0);
|
||||
}
|
||||
5
apps/apps_container_launch_on_boarding.cpp
Normal file
5
apps/apps_container_launch_on_boarding.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
#include "apps_container.h"
|
||||
|
||||
App::Snapshot * AppsContainer::initialAppSnapshot() {
|
||||
return onBoardingAppSnapshot();
|
||||
}
|
||||
@@ -6,6 +6,8 @@
|
||||
#if DUMMY_MAIN
|
||||
|
||||
void ion_main(int argc, char * argv[]) {
|
||||
// Initialize the backlight
|
||||
Ion::Backlight::init();
|
||||
while (1) {
|
||||
Ion::Display::pushRectUniform(KDRect(0,0,10,10), KDColorRed);
|
||||
Ion::Timing::msleep(100);
|
||||
|
||||
@@ -33,9 +33,9 @@ void LogoController::viewWillAppear() {
|
||||
m_didPerformTests = true;
|
||||
m_previousLEDColor = PowerOnSelfTest::Perform();
|
||||
}
|
||||
/* If EPSILON_ONBOARDING_APP == 1, the backlight is not initialized in
|
||||
* Ion::Device::Board::initPeripherals, so that the LCD test is not visible to
|
||||
* the user. We thus need to initialize the backlight after the test.*/
|
||||
/* The backlight was not initialized in Ion::Device::Board::initPeripherals,
|
||||
* so that the LCD test is not visible to the user. We thus need to initialize
|
||||
* the backlight after the test.*/
|
||||
if (!backlightInitialized) {
|
||||
Ion::Backlight::init();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#include <ion/src/device/bench/bench.h>
|
||||
#include <ion/backlight.h>
|
||||
|
||||
void ion_main(int argc, char * argv[]) {
|
||||
// Initialize the backlight
|
||||
Ion::Backlight::init();
|
||||
Ion::Device::Bench::run();
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
#include <ion.h>
|
||||
|
||||
void ion_main(int argc, char * argv[]) {
|
||||
// Initialize the backlight
|
||||
Ion::Backlight::init();
|
||||
// Initialize Flasher display
|
||||
Flasher::Display::init();
|
||||
while (true) {
|
||||
Ion::USB::enable();
|
||||
|
||||
@@ -31,14 +31,12 @@ void __attribute__((noinline)) abort() {
|
||||
* forbid inlining it.*/
|
||||
|
||||
static void __attribute__((noinline)) external_flash_start() {
|
||||
/* Init the peripherals. If there is the on boarding app, do not initialize the
|
||||
* backlight so that the user does not see the LCD tests. The backlight will
|
||||
* be initialized after the Power-On Self-Test.*/
|
||||
#if EPSILON_ONBOARDING_APP == 0
|
||||
Ion::Device::Board::initPeripherals(true);
|
||||
#else
|
||||
/* Init the peripherals. We do not initialize the backlight in case there is
|
||||
* an on boarding app: indeed, we don't want the user to see the LCD tests
|
||||
* happening during the on boarding app. The backlight will be initialized
|
||||
* after the Power-On Self-Test if there is one or before switching to the
|
||||
* home app otherwise. */
|
||||
Ion::Device::Board::initPeripherals(false);
|
||||
#endif
|
||||
|
||||
return ion_main(0, nullptr);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,8 @@ static inline void ion_main_inner() {
|
||||
}
|
||||
|
||||
void ion_main(int argc, char * argv[]) {
|
||||
// Initialize the backlight
|
||||
Ion::Backlight::init();
|
||||
// Initialize Poincare::TreePool::sharedPool
|
||||
Poincare::Init();
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ PLATFORM ?= device
|
||||
DEBUG ?= 0
|
||||
|
||||
EPSILON_VERSION ?= 11.1.0
|
||||
EPSILON_ONBOARDING_APP ?= 0
|
||||
# Valid values are "none", "update", "beta"
|
||||
EPSILON_BOOT_PROMPT ?= none
|
||||
EPSILON_APPS ?= calculation graph code statistics probability solver sequence regression settings
|
||||
@@ -23,7 +22,6 @@ endif
|
||||
include scripts/toolchain.$(TOOLCHAIN).mak
|
||||
|
||||
SFLAGS += -DDEBUG=$(DEBUG)
|
||||
SFLAGS += -DEPSILON_ONBOARDING_APP=$(EPSILON_ONBOARDING_APP)
|
||||
SFLAGS += -DEPSILON_GETOPT=$(EPSILON_GETOPT)
|
||||
EPSILON_BETA_PROMPT := 1
|
||||
EPSILON_UPDATE_PROMPT := 2
|
||||
|
||||
@@ -2,7 +2,6 @@ TOOLCHAIN ?= host-gcc
|
||||
USE_LIBA ?= 0
|
||||
ION_KEYBOARD_LAYOUT = layout_B2
|
||||
EXE = bin
|
||||
EPSILON_ONBOARDING_APP = 0
|
||||
|
||||
ifeq ($(DEBUG),1)
|
||||
else
|
||||
|
||||
@@ -2,5 +2,4 @@ TOOLCHAIN = emscripten
|
||||
USE_LIBA = 0
|
||||
ION_KEYBOARD_LAYOUT = layout_B2
|
||||
EXE = js
|
||||
EPSILON_ONBOARDING_APP = 0
|
||||
EPSILON_GETOPT = 1
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
USE_LIBA = 0
|
||||
ION_KEYBOARD_LAYOUT = layout_B2
|
||||
EPSILON_ONBOARDING_APP = 0
|
||||
EPSILON_GETOPT = 1
|
||||
|
||||
SFLAGS += -fPIE
|
||||
|
||||
@@ -71,9 +71,9 @@ $(BUILD_DIR)/bench.ram.$(EXE): LDSCRIPT = ion/src/$(PLATFORM)/shared/ram.ld
|
||||
$(BUILD_DIR)/bench.flash.$(EXE): LDSCRIPT = ion/src/$(PLATFORM)/$(MODEL)/internal_flash.ld
|
||||
$(BUILD_DIR)/bench.%.$(EXE): $(call object_for,$(src) $(bench_src) $(ion_device_dfu_xip_src))
|
||||
|
||||
ifeq ($(EPSILON_ONBOARDING_APP)$(EPSILON_BOOT_PROMPT),1update)
|
||||
.PHONY: %_two_binaries
|
||||
%_two_binaries: %.elf
|
||||
ifeq ($(EPSILON_BOOT_PROMPT),update)
|
||||
.PHONY: %.two_binaries
|
||||
%.two_binaries: %.elf
|
||||
@echo "Building an internal and an external binary for $<"
|
||||
$(Q) $(OBJCOPY) -O binary -j .text.external -j .rodata.external $< $(basename $<).external.bin
|
||||
$(Q) $(OBJCOPY) -O binary -R .text.external -R .rodata.external $< $(basename $<).internal.bin
|
||||
@@ -82,7 +82,7 @@ ifeq ($(EPSILON_ONBOARDING_APP)$(EPSILON_BOOT_PROMPT),1update)
|
||||
$(Q) printf "\xFF\xFF\xFF\xFF" >> $(basename $<).internal.bin
|
||||
else
|
||||
%_two_binaries:
|
||||
@echo "Error: two_binaries requires EPSILON_ONBOARDING_APP=1 EPSILON_BOOT_PROMPT=update"
|
||||
@echo "Error: two_binaries requires EPSILON_BOOT_PROMPT=update"
|
||||
endif
|
||||
|
||||
.PHONY: binpack
|
||||
@@ -97,9 +97,9 @@ binpack:
|
||||
make -j8 $(BUILD_DIR)/bench.ram.bin
|
||||
cp $(BUILD_DIR)/bench.ram.bin $(BUILD_DIR)/bench.flash.bin build/binpack
|
||||
make clean
|
||||
make -j8 EPSILON_ONBOARDING_APP=1 EPSILON_BOOT_PROMPT=update $(BUILD_DIR)/epsilon_two_binaries
|
||||
cp $(BUILD_DIR)/epsilon.internal.bin $(BUILD_DIR)/epsilon.external.bin build/binpack
|
||||
make -j8 EPSILON_BOOT_PROMPT=update $(BUILD_DIR)/epsilon.on-boarding.two_binaries
|
||||
cp $(BUILD_DIR)/epsilon.on-boarding.internal.bin $(BUILD_DIR)/epsilon.on-boarding.external.bin build/binpack
|
||||
make clean
|
||||
cd build && for binary in flasher.light.bin bench.flash.bin bench.ram.bin epsilon.internal.bin epsilon.external.bin; do shasum -a 256 -b binpack/$${binary} > binpack/$${binary}.sha256;done
|
||||
cd build && for binary in flasher.light.bin bench.flash.bin bench.ram.bin epsilon.on-boarding.internal.bin epsilon.on-boarding.external.bin; do shasum -a 256 -b binpack/$${binary} > binpack/$${binary}.sha256;done
|
||||
cd build && tar cvfz binpack-`git rev-parse HEAD | head -c 7`.tgz binpack
|
||||
rm -rf build/binpack
|
||||
|
||||
Reference in New Issue
Block a user