diff --git a/cmake-nRF5x/CMake_nRF5x.cmake b/cmake-nRF5x/CMake_nRF5x.cmake index ead7b9f6..c7d0a68b 100755 --- a/cmake-nRF5x/CMake_nRF5x.cmake +++ b/cmake-nRF5x/CMake_nRF5x.cmake @@ -74,21 +74,6 @@ macro(nRF5x_setup) ) endif () - set(COMMON_FLAGS "-MP -MD -mthumb -mabi=aapcs -Wall -g3 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums ${CPU_FLAGS} -Wreturn-type -Werror=return-type") - - # compiler/assambler/linker flags - set(CMAKE_C_FLAGS "${COMMON_FLAGS}") - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g3") - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3") - 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 -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 ") - # basic board definitions and drivers include_directories( "${NRF5_SDK_PATH}/components" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 43608568..cd729921 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -744,7 +744,7 @@ link_directories( ) -set(COMMON_FLAGS -MP -MD -mthumb -mabi=aapcs -Wall -Wno-unknown-pragmas -g3 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wreturn-type -Werror=return-type) +set(COMMON_FLAGS -MP -MD -mthumb -mabi=aapcs -Wall -Wno-unknown-pragmas -g3 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wreturn-type -Werror=return-type -fstack-usage -fno-exceptions -fno-non-call-exceptions) add_definitions(-DCONFIG_GPIO_AS_PINRESET) add_definitions(-DNIMBLE_CFG_CONTROLLER) add_definitions(-DOS_CPUTIME_FREQ) @@ -766,10 +766,10 @@ add_library(nrf-sdk STATIC ${SDK_SOURCE_FILES}) target_include_directories(nrf-sdk SYSTEM PUBLIC . ../) target_include_directories(nrf-sdk SYSTEM PUBLIC ${INCLUDES_FROM_LIBS}) target_compile_options(nrf-sdk PRIVATE - $<$,$>: ${COMMON_FLAGS} -O0 -g3> - $<$,$>: ${COMMON_FLAGS} -O3> - $<$,$>: ${COMMON_FLAGS} -O0> - $<$,$>: ${COMMON_FLAGS} -O3> + $<$,$>: ${COMMON_FLAGS} -Og -g3> + $<$,$>: ${COMMON_FLAGS} -Os> + $<$,$>: ${COMMON_FLAGS} -Og -fno-rtti> + $<$,$>: ${COMMON_FLAGS} -Os -fno-rtti> $<$: -MP -MD -x assembler-with-cpp> ) @@ -778,10 +778,10 @@ add_library(nimble STATIC ${NIMBLE_SRC} ${TINYCRYPT_SRC}) target_include_directories(nimble SYSTEM PUBLIC . ../) target_include_directories(nimble SYSTEM PUBLIC ${INCLUDES_FROM_LIBS}) target_compile_options(nimble PRIVATE - $<$,$>: ${COMMON_FLAGS} -O0 -g3 -Wno-unused-but-set-variable -Wno-maybe-uninitialized> - $<$,$>: ${COMMON_FLAGS} -O3 -Wno-unused-but-set-variable -Wno-maybe-uninitialized> - $<$,$>: ${COMMON_FLAGS} -O0 -g3 -Wno-unused-but-set-variable -Wno-maybe-uninitialized> - $<$,$>: ${COMMON_FLAGS} -O3 -Wno-unused-but-set-variable -Wno-maybe-uninitialized> + $<$,$>: ${COMMON_FLAGS} -Og -g3 -Wno-unused-but-set-variable -Wno-maybe-uninitialized> + $<$,$>: ${COMMON_FLAGS} -Os -Wno-unused-but-set-variable -Wno-maybe-uninitialized> + $<$,$>: ${COMMON_FLAGS} -Og -g3 -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-rtti> + $<$,$>: ${COMMON_FLAGS} -Os -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-rtti> $<$: -MP -MD -x assembler-with-cpp> ) @@ -790,10 +790,10 @@ add_library(lvgl STATIC ${LVGL_SRC}) target_include_directories(lvgl SYSTEM PUBLIC . ../) target_include_directories(lvgl SYSTEM PUBLIC ${INCLUDES_FROM_LIBS}) target_compile_options(lvgl PRIVATE - $<$,$>: ${COMMON_FLAGS} -O0 -g3> - $<$,$>: ${COMMON_FLAGS} -O3> - $<$,$>: ${COMMON_FLAGS} -O0 -g3> - $<$,$>: ${COMMON_FLAGS} -O3> + $<$,$>: ${COMMON_FLAGS} -Og -g3> + $<$,$>: ${COMMON_FLAGS} -Os> + $<$,$>: ${COMMON_FLAGS} -Og -g3 -fno-rtti> + $<$,$>: ${COMMON_FLAGS} -Os -fno-rtti> $<$: -MP -MD -x assembler-with-cpp> ) @@ -805,10 +805,10 @@ add_executable(${EXECUTABLE_NAME} ${SOURCE_FILES}) set_target_properties(${EXECUTABLE_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_FILE_NAME}) target_link_libraries(${EXECUTABLE_NAME} nimble nrf-sdk lvgl) target_compile_options(${EXECUTABLE_NAME} PUBLIC - $<$,$>: ${COMMON_FLAGS} -O0 -g3> - $<$,$>: ${COMMON_FLAGS} -O3> - $<$,$>: ${COMMON_FLAGS} -O0 -g3> - $<$,$>: ${COMMON_FLAGS} -O3> + $<$,$>: ${COMMON_FLAGS} -Og -g3> + $<$,$>: ${COMMON_FLAGS} -Os> + $<$,$>: ${COMMON_FLAGS} -Og -g3 -fno-rtti> + $<$,$>: ${COMMON_FLAGS} -Os -fno-rtti> $<$: -MP -MD -x assembler-with-cpp> ) @@ -835,10 +835,10 @@ add_executable(${EXECUTABLE_MCUBOOT_NAME} ${SOURCE_FILES}) target_link_libraries(${EXECUTABLE_MCUBOOT_NAME} nimble nrf-sdk lvgl) set_target_properties(${EXECUTABLE_MCUBOOT_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_MCUBOOT_FILE_NAME}) target_compile_options(${EXECUTABLE_MCUBOOT_NAME} PUBLIC - $<$,$>: ${COMMON_FLAGS} -O0 -g3> - $<$,$>: ${COMMON_FLAGS} -O3> - $<$,$>: ${COMMON_FLAGS} -O0 -g3> - $<$,$>: ${COMMON_FLAGS} -O3> + $<$,$>: ${COMMON_FLAGS} -Og -g3> + $<$,$>: ${COMMON_FLAGS} -Os> + $<$,$>: ${COMMON_FLAGS} -Og -g3 -fno-rtti> + $<$,$>: ${COMMON_FLAGS} -Os -fno-rtti> $<$: -MP -MD -x assembler-with-cpp> ) @@ -872,10 +872,10 @@ target_link_libraries(${EXECUTABLE_RECOVERY_NAME} nimble nrf-sdk) set_target_properties(${EXECUTABLE_RECOVERY_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_RECOVERY_FILE_NAME}) target_compile_definitions(${EXECUTABLE_RECOVERY_NAME} PUBLIC "PINETIME_IS_RECOVERY") target_compile_options(${EXECUTABLE_RECOVERY_NAME} PUBLIC - $<$,$>: ${COMMON_FLAGS} -O0 -g3> - $<$,$>: ${COMMON_FLAGS} -O3> - $<$,$>: ${COMMON_FLAGS} -O0 -g3> - $<$,$>: ${COMMON_FLAGS} -O3> + $<$,$>: ${COMMON_FLAGS} -Og -g3> + $<$,$>: ${COMMON_FLAGS} -Os> + $<$,$>: ${COMMON_FLAGS} -Og -g3 -fno-rtti> + $<$,$>: ${COMMON_FLAGS} -Os -fno-rtti> $<$: -MP -MD -x assembler-with-cpp> ) @@ -902,10 +902,10 @@ target_link_libraries(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} nimble nrf-sdk) set_target_properties(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_RECOVERY_MCUBOOT_FILE_NAME}) target_compile_definitions(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} PUBLIC "PINETIME_IS_RECOVERY") target_compile_options(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} PUBLIC - $<$,$>: ${COMMON_FLAGS} -O0 -g3> - $<$,$>: ${COMMON_FLAGS} -O3> - $<$,$>: ${COMMON_FLAGS} -O0 -g3> - $<$,$>: ${COMMON_FLAGS} -O3> + $<$,$>: ${COMMON_FLAGS} -Og -g3> + $<$,$>: ${COMMON_FLAGS} -Os> + $<$,$>: ${COMMON_FLAGS} -Og -g3 -fno-rtti> + $<$,$>: ${COMMON_FLAGS} -Os -fno-rtti> $<$: -MP -MD -x assembler-with-cpp> ) @@ -939,10 +939,10 @@ add_executable(${EXECUTABLE_RECOVERYLOADER_NAME} ${RECOVERYLOADER_SOURCE_FILES}) target_link_libraries(${EXECUTABLE_RECOVERYLOADER_NAME} nrf-sdk) set_target_properties(${EXECUTABLE_RECOVERYLOADER_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_RECOVERYLOADER_FILE_NAME}) target_compile_options(${EXECUTABLE_RECOVERYLOADER_NAME} PUBLIC - $<$,$>: ${COMMON_FLAGS} -O0 -g3> - $<$,$>: ${COMMON_FLAGS} -O3> - $<$,$>: ${COMMON_FLAGS} -O0 -g3> - $<$,$>: ${COMMON_FLAGS} -O3> + $<$,$>: ${COMMON_FLAGS} -Og -g3> + $<$,$>: ${COMMON_FLAGS} -Os> + $<$,$>: ${COMMON_FLAGS} -Og -g3 -fno-rtti> + $<$,$>: ${COMMON_FLAGS} -Os -fno-rtti> $<$: -MP -MD -x assembler-with-cpp> ) target_include_directories(${EXECUTABLE_RECOVERYLOADER_NAME} PUBLIC @@ -972,10 +972,10 @@ add_executable(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} ${RECOVERYLOADER_SOURCE target_link_libraries(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} nrf-sdk) set_target_properties(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}) target_compile_options(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} PUBLIC - $<$,$>: ${COMMON_FLAGS} -O0 -g3> - $<$,$>: ${COMMON_FLAGS} -O3> - $<$,$>: ${COMMON_FLAGS} -O0 -g3> - $<$,$>: ${COMMON_FLAGS} -O3> + $<$,$>: ${COMMON_FLAGS} -Og -g3> + $<$,$>: ${COMMON_FLAGS} -Os> + $<$,$>: ${COMMON_FLAGS} -Og -g3 -fno-rtti> + $<$,$>: ${COMMON_FLAGS} -Os -fno-rtti> $<$: -MP -MD -x assembler-with-cpp> ) target_include_directories(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} PUBLIC diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 419b9f6f..7b03d569 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -153,7 +153,7 @@ void DisplayApp::Refresh() { break; case Messages::TimerDone: if (currentApp == Apps::Timer) { - auto *timer = dynamic_cast(currentScreen.get()); + auto *timer = static_cast(currentScreen.get()); timer->setDone(); } else { LoadApp(Apps::Timer, DisplayApp::FullRefreshDirections::Down);