From 25f35c7d0e27af4308b8c263fde6661dbe29c2cc Mon Sep 17 00:00:00 2001 From: Jean-François Milants Date: Tue, 26 Jan 2021 20:31:45 +0100 Subject: Generate pinetime-recovery : a light version of InfiniTime design to be used as a recovery firmware : it only provides basic UI and BLE connectivity for OTA. This new FW is build on the same codebasse than the actual InfiniTime. Only the display task is different (this allows to remove lvgl from the recovery fw, which is very heavy). CMake builds and docker have been modified accordingly. Note than the fw is converted into an image and then into a DFU in the cmake build (previously, it was only done in the --- src/main.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 3b993ee9..56bc35bc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -31,8 +31,6 @@ #include "components/ble/BleController.h" #include "components/ble/NotificationManager.h" #include "components/datetime/DateTimeController.h" -#include "displayapp/DisplayApp.h" -#include "displayapp/LittleVgl.h" #include "drivers/Spi.h" #include "drivers/SpiMaster.h" #include "drivers/SpiNorFlash.h" @@ -84,7 +82,18 @@ Pinetime::Drivers::TwiMaster twiMaster{Pinetime::Drivers::TwiMaster::Modules::TW Pinetime::Drivers::TwiMaster::Parameters { MaxTwiFrequencyWithoutHardwareBug, pinTwiSda, pinTwiScl}}; Pinetime::Drivers::Cst816S touchPanel {twiMaster, touchPanelTwiAddress}; +#ifdef PINETIME_IS_RECOVERY +static constexpr bool isFactory = true; +#include "displayapp/DummyLittleVgl.h" +#include "displayapp/DisplayAppRecovery.h" +Pinetime::Components::LittleVgl lvgl {lcd, touchPanel}; +#else +static constexpr bool isFactory = false; +#include "displayapp/LittleVgl.h" +#include "displayapp/DisplayApp.h" Pinetime::Components::LittleVgl lvgl {lcd, touchPanel}; +#endif + Pinetime::Drivers::Hrs3300 heartRateSensor {twiMaster, heartRateSensorTwiAddress}; @@ -113,7 +122,8 @@ void nrfx_gpiote_evt_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action extern "C" { void vApplicationIdleHook(void) { - lv_tick_inc(1); + if(!isFactory) + lv_tick_inc(1); } } -- cgit v1.2.3-70-g09d2