diff --git a/CMakeLists.txt b/CMakeLists.txt index ac7c8903..633cc674 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,16 @@ cmake_minimum_required(VERSION 3.10) project(pinetime VERSION 0.14.0 LANGUAGES C CXX ASM) +set(CMAKE_C_STANDARD 99) +set(CMAKE_CXX_STANDARD 14) + +# set(CMAKE_GENERATOR "Unix Makefiles") +set(CMAKE_C_EXTENSIONS OFF) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + set(NRF_TARGET "nrf52") if (NOT ARM_NONE_EABI_TOOLCHAIN_PATH) diff --git a/cmake-nRF5x/CMake_nRF5x.cmake b/cmake-nRF5x/CMake_nRF5x.cmake index c1785d36..ead7b9f6 100755 --- a/cmake-nRF5x/CMake_nRF5x.cmake +++ b/cmake-nRF5x/CMake_nRF5x.cmake @@ -36,9 +36,6 @@ macro(nRF5x_setup) set(CMAKE_OSX_SYSROOT "/") set(CMAKE_OSX_DEPLOYMENT_TARGET "") - # language standard/version settings - set(CMAKE_C_STANDARD 99) - set(CMAKE_CXX_STANDARD 11) # CPU specyfic settings if (NRF_TARGET MATCHES "nrf51") @@ -86,8 +83,8 @@ macro(nRF5x_setup) set(CMAKE_CXX_FLAGS "${COMMON_FLAGS}") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g3") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") - set(CMAKE_ASM_FLAGS "-MP -MD -std=c99 -x assembler-with-cpp") - set(CMAKE_EXE_LINKER_FLAGS "-mthumb -mabi=aapcs -std=gnu++98 -std=c99 -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT} ${CPU_FLAGS} -Wl,--gc-sections --specs=nano.specs -lc -lnosys -lm") + set(CMAKE_ASM_FLAGS "-MP -MD -x assembler-with-cpp") + set(CMAKE_EXE_LINKER_FLAGS "-mthumb -mabi=aapcs -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT} ${CPU_FLAGS} -Wl,--gc-sections --specs=nano.specs -lc -lnosys -lm") # note: we must override the default cmake linker flags so that CMAKE_C_FLAGS are not added implicitly set(CMAKE_C_LINK_EXECUTABLE "${CMAKE_C_COMPILER} -o ") set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_C_COMPILER} -lstdc++ -o ") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2cf570be..6a4c1106 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,16 +3,6 @@ cmake_minimum_required(VERSION 3.10) project(pinetime-app C CXX ASM) -set(CMAKE_C_STANDARD 99) -set(CMAKE_CXX_STANDARD 14) - -# set(CMAKE_GENERATOR "Unix Makefiles") -set(CMAKE_C_EXTENSIONS OFF) -set(CMAKE_C_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - # define some variables just for this example to determine file locations set(NRF_PROJECT_NAME pinetime-app) set(NRF_BOARD pca10040) @@ -805,8 +795,6 @@ target_compile_options(${EXECUTABLE_NAME} PUBLIC set_target_properties(${EXECUTABLE_NAME} PROPERTIES SUFFIX ".out" LINK_FLAGS "-mthumb -mabi=aapcs -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections --specs=nano.specs -lc -lnosys -lm -Wl,-Map=${EXECUTABLE_FILE_NAME}.map" - CXX_STANDARD 11 - C_STANDARD 99 ) add_custom_command(TARGET ${EXECUTABLE_NAME} @@ -837,8 +825,6 @@ target_compile_options(${EXECUTABLE_MCUBOOT_NAME} PUBLIC set_target_properties(${EXECUTABLE_MCUBOOT_NAME} PROPERTIES SUFFIX ".out" LINK_FLAGS "-mthumb -mabi=aapcs -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT_MCUBOOT} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections --specs=nano.specs -lc -lnosys -lm -Wl,-Map=${EXECUTABLE_MCUBOOT_FILE_NAME}.map" - CXX_STANDARD 11 - C_STANDARD 99 ) add_custom_command(TARGET ${EXECUTABLE_MCUBOOT_NAME} @@ -866,8 +852,6 @@ target_compile_options(${EXECUTABLE_GRAPHICS_NAME} PUBLIC set_target_properties(${EXECUTABLE_GRAPHICS_NAME} PROPERTIES SUFFIX ".out" LINK_FLAGS "-mthumb -mabi=aapcs -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections --specs=nano.specs -lc -lnosys -lm -Wl,-Map=${EXECUTABLE_GRAPHICS_FILE_NAME}.map" - CXX_STANDARD 11 - C_STANDARD 99 ) add_custom_command(TARGET ${EXECUTABLE_GRAPHICS_NAME} diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 6e6360a4..7f845c08 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -24,6 +24,8 @@ #include "drivers/Hrs3300.h" #include "main.h" +#include + using namespace Pinetime::System; void IdleTimerCallback(TimerHandle_t xTimer) { @@ -82,9 +84,9 @@ void SystemTask::Work() { motorController.Init(); - displayApp.reset(new Pinetime::Applications::DisplayApp(lcd, lvgl, touchPanel, batteryController, bleController, + displayApp = std::make_unique(lcd, lvgl, touchPanel, batteryController, bleController, dateTimeController, watchdogView, *this, notificationManager, - heartRateController)); + heartRateController); displayApp->Start(); batteryController.Update();