From 1b6acdedc2ae892bece04479a64ad28120eced8c Mon Sep 17 00:00:00 2001 From: JF002 Date: Tue, 1 Jun 2021 21:03:01 +0200 Subject: Enable various compilation flags to reduce the binary size (#401) * Add the following compilation flags: * -fno-exceptions and -fno-non-call-exceptions : disable exception handling * -fno-rtti : disable run time type information (needed by dynamic_cast, for example) These flags reduce the binary size by about 100KB! Also, -fstack-usage generate debug info (not in final binary) to allow tools like Puncover to do a stack analysis. * Remove unused CMake variables in CMake_nRF5x.cmake (duplicated in src/CMakeLists.txt). Replace -O0 by -Og in DEBUG builds. This generates a smaller binary (small enough for the internal memory) that is debugger friendly. --- src/displayapp/DisplayApp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/displayapp') 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); -- cgit v1.2.3-70-g09d2