InfiniTime.git

commit 9906a708c9fcbc13f47bdba0cb8512799a2a3719

Author: JF <jf@codingfield.com>

Merge branch 'removeWarnings' of JF/PineTime into develop

 src/BlinkApp/BlinkApp.cpp | 25 -----
 src/BlinkApp/BlinkApp.h | 15 ---
 src/CMakeLists.txt | 50 ++++++++--
 src/Components/Ble/AlertNotificationClient.cpp | 2 
 src/Components/Ble/AlertNotificationService.cpp | 9 -
 src/Components/Ble/CurrentTimeService.cpp | 5 
 src/Components/Ble/DeviceInformationService.h | 10 +-
 src/Components/Ble/DfuService.cpp | 4 
 src/Components/Ble/MusicService.cpp | 3 
 src/Components/Ble/NimbleController.cpp | 7 
 src/Components/Ble/NimbleController.h | 2 
 src/DisplayApp/DisplayApp.cpp | 3 
 src/DisplayApp/DisplayApp.h | 7 
 src/DisplayApp/LittleVgl.h | 4 
 src/DisplayApp/Screens/Clock.cpp | 5 
 src/DisplayApp/Screens/FirmwareValidation.cpp | 2 
 src/DisplayApp/Screens/Message.cpp | 81 ------------------
 src/DisplayApp/Screens/Message.h | 31 ------
 src/DisplayApp/Screens/Symbols.h | 38 ++++----
 src/DisplayApp/Screens/SystemInfo.cpp | 7 
 src/DisplayApp/Screens/Tile.cpp | 1 
 src/SystemTask/SystemMonitor.h | 2 
 src/SystemTask/SystemTask.cpp | 1 
 src/drivers/Cst816s.cpp | 7 
 src/drivers/SpiMaster.cpp | 2 
 src/graphics.cpp | 4 
 src/libs/mynewt-nimble/nimble/host/src/ble_gap.c | 2 


diff --git a/src/BlinkApp/BlinkApp.cpp b/src/BlinkApp/BlinkApp.cpp
deleted file mode 100644
index a988dfd3a8f3558f05f568e1f6830544a2f5f046..0000000000000000000000000000000000000000
--- a/src/BlinkApp/BlinkApp.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "BlinkApp.h"
-#include <FreeRTOS.h>
-#include <task.h>
-#include <libraries/log/nrf_log.h>
-#include <boards.h>
-
-using namespace Pinetime::Applications;
-
-void BlinkApp::Start() {
-  if (pdPASS != xTaskCreate(BlinkApp::Process, "BlinkApp", 256, this, 0, &taskHandle))
-    APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
-}
-
-void BlinkApp::Process(void *instance) {
-  auto* app = static_cast<BlinkApp*>(instance);
-
-  NRF_LOG_INFO("BlinkApp task started!");
-  while (1) {
-//    NRF_LOG_INFO("BlinkApp task running!");
-//    nrf_gpio_pin_toggle(22);
-//    nrf_gpio_pin_toggle(23);
-//    nrf_gpio_pin_toggle(14);
-    vTaskDelay(1000);
-  }
-}




diff --git a/src/BlinkApp/BlinkApp.h b/src/BlinkApp/BlinkApp.h
deleted file mode 100644
index 15c863a347c516f803c55a3bf8854ab28dddd6b1..0000000000000000000000000000000000000000
--- a/src/BlinkApp/BlinkApp.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#pragma once
-#include <FreeRTOS.h>
-#include <task.h>
-
-namespace Pinetime {
-  namespace Applications {
-    class BlinkApp {
-      public:
-        void Start();
-      private:
-        TaskHandle_t taskHandle;
-        static void Process(void* instance);
-    };
-  }
-}




diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c4487afe9bc300153070ccd5497fe81e380d2a3e..d5b4e1beddc031fa06f13420c2f4ad7802a7f597 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -321,11 +321,9 @@   )
 
 list(APPEND SOURCE_FILES
   Logging/NrfLogger.cpp
-  BlinkApp/BlinkApp.cpp
   DisplayApp/DisplayApp.cpp
   DisplayApp/Screens/Screen.cpp
   DisplayApp/Screens/Clock.cpp
-  DisplayApp/Screens/Message.cpp
   DisplayApp/Screens/Tile.cpp
   DisplayApp/Screens/Meter.cpp
   DisplayApp/Screens/Gauge.cpp
@@ -365,11 +363,6 @@   drivers/Cst816s.cpp
   FreeRTOS/port.c
   FreeRTOS/port_cmsis_systick.c
   FreeRTOS/port_cmsis.c
-  ${TINYCRYPT_SRC}
-  ${NIMBLE_SRC}
-  ${LVGL_SRC}
-  #${IMAGE_FILES}
-  ${SDK_SOURCE_FILES}
 
   DisplayApp/LittleVgl.cpp
   DisplayApp/Fonts/jetbrains_mono_extrabold_compressed.c
@@ -380,8 +373,6 @@     drivers/TwiMaster.cpp
 )
 
 list(APPEND GRAPHICS_SOURCE_FILES
-    ${SDK_SOURCE_FILES}
-
     # FreeRTOS
     FreeRTOS/port.c
     FreeRTOS/port_cmsis_systick.c
@@ -402,12 +393,10 @@
 set(INCLUDE_FILES
   Logging/Logger.h
   Logging/NrfLogger.h
-  BlinkApp/BlinkApp.h
   DisplayApp/DisplayApp.h
   DisplayApp/TouchEvents.h
   DisplayApp/Screens/Screen.h
   DisplayApp/Screens/Clock.h
-  DisplayApp/Screens/Message.h
   DisplayApp/Screens/Tile.h
   DisplayApp/Screens/Meter.h
   DisplayApp/Screens/Gauge.h
@@ -568,10 +557,47 @@ if(NOT CMAKE_BUILD_TYPE)
   set(CMAKE_BUILD_TYPE "Release")
 endif()
 
+# NRF SDK
+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
+    $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -O0 -g3>
+    $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -O3>
+    $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -O0>
+    $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -O3>
+    $<$<COMPILE_LANGUAGE:ASM>: -MP -MD -std=c99 -x assembler-with-cpp>
+    )
+
+# NimBLE
+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
+    $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -O0 -g3 -Wno-unused-but-set-variable -Wno-maybe-uninitialized>
+    $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -O3 -Wno-unused-but-set-variable -Wno-maybe-uninitialized>
+    $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -O0 -g3 -Wno-unused-but-set-variable -Wno-maybe-uninitialized>
+    $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -O3 -Wno-unused-but-set-variable -Wno-maybe-uninitialized>
+    $<$<COMPILE_LANGUAGE:ASM>: -MP -MD -std=c99 -x assembler-with-cpp>
+    )
+
+# lvgl
+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
+    $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -O0 -g3>
+    $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -O3>
+    $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -O0 -g3>
+    $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -O3>
+    $<$<COMPILE_LANGUAGE:ASM>: -MP -MD -std=c99 -x assembler-with-cpp>
+    )
+
 # Build autonomous binary (without support for bootloader)
 set(EXECUTABLE_NAME "pinetime-app")
 set(NRF5_LINKER_SCRIPT "${CMAKE_SOURCE_DIR}/gcc_nrf52.ld")
 add_executable(${EXECUTABLE_NAME} ${SOURCE_FILES})
+target_link_libraries(${EXECUTABLE_NAME} nimble nrf-sdk lvgl)
 target_compile_options(${EXECUTABLE_NAME} PUBLIC
         $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -O0 -g3>
         $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -O3>
@@ -600,6 +626,7 @@ set(EXECUTABLE_MCUBOOT_NAME "pinetime-mcuboot-app")
 set(EXECUTABLE_MCUBOOT_WITH_BOOTLOADER_NAME "pinetime-mcuboot-app-wth-bootloader")
 set(NRF5_LINKER_SCRIPT_MCUBOOT "${CMAKE_SOURCE_DIR}/gcc_nrf52-mcuboot.ld")
 add_executable(${EXECUTABLE_MCUBOOT_NAME} ${SOURCE_FILES})
+target_link_libraries(${EXECUTABLE_MCUBOOT_NAME} nimble nrf-sdk lvgl)
 target_compile_options(${EXECUTABLE_MCUBOOT_NAME} PUBLIC
         $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -O0 -g3>
         $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -O3>
@@ -626,6 +653,7 @@
 # Build binary that writes the graphic assets for the bootloader
 set(EXECUTABLE_GRAPHICS_NAME "pinetime-graphics")
 add_executable(${EXECUTABLE_GRAPHICS_NAME} ${GRAPHICS_SOURCE_FILES})
+target_link_libraries(${EXECUTABLE_GRAPHICS_NAME} nrf-sdk)
 target_compile_options(${EXECUTABLE_GRAPHICS_NAME} PUBLIC
     $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -O0 -g3>
     $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -O3>




diff --git a/src/Components/Ble/AlertNotificationClient.cpp b/src/Components/Ble/AlertNotificationClient.cpp
index b65e019da5e5e403c6e8a43f238cad133d551e08..3e4b495fb741c1f5f58e8b78b5391ad31e066228 100644
--- a/src/Components/Ble/AlertNotificationClient.cpp
+++ b/src/Components/Ble/AlertNotificationClient.cpp
@@ -116,7 +116,7 @@
     char *s = (char *) &data[3];
     auto messageSize = min(maxMessageSize, (bufferSize-3));
 
-    for (int i = 0; i < messageSize-1; i++) {
+    for (uint i = 0; i < messageSize-1; i++) {
       if (s[i] == 0x00) {
         s[i] = 0x0A;
       }




diff --git a/src/Components/Ble/AlertNotificationService.cpp b/src/Components/Ble/AlertNotificationService.cpp
index 0faa17c806ac6482cb0a2871be19fcc11021af86..ce2f7dd7b9d2faf10281d6ec8e16c91972f2f53e 100644
--- a/src/Components/Ble/AlertNotificationService.cpp
+++ b/src/Components/Ble/AlertNotificationService.cpp
@@ -26,8 +26,8 @@   res = ble_gatts_add_svcs(serviceDefinition);
   ASSERT(res == 0);
 }
 
-AlertNotificationService::AlertNotificationService ( Pinetime::System::SystemTask& systemTask, Pinetime::Controllers::NotificationManager& notificationManager ) : m_systemTask{systemTask}, m_notificationManager{notificationManager},
-    characteristicDefinition{
+AlertNotificationService::AlertNotificationService ( System::SystemTask& systemTask, NotificationManager& notificationManager )
+  : characteristicDefinition{
                 {
                         .uuid = (ble_uuid_t *) &ansCharUuid,
                         .access_cb = AlertNotificationCallback,
@@ -48,8 +48,7 @@                 },
                 {
                         0
                 },
-        }
-{
+        }, m_systemTask{systemTask}, m_notificationManager{notificationManager} {
 }
 
 int AlertNotificationService::OnAlert(uint16_t conn_handle, uint16_t attr_handle,
@@ -67,7 +66,7 @@
     char *s = (char *) &data[3];
     auto messageSize = min(maxMessageSize, (bufferSize-3));
 
-    for (int i = 0; i < messageSize-1; i++) {
+    for (uint i = 0; i < messageSize-1; i++) {
       if (s[i] == 0x00) {
         s[i] = 0x0A;
       }




diff --git a/src/Components/Ble/CurrentTimeService.cpp b/src/Components/Ble/CurrentTimeService.cpp
index 80ad9c25fcfbc5b1e6eec3c73c508f4935c66d61..3a6264e2bebd353b2d5a40173b823593ced61103 100644
--- a/src/Components/Ble/CurrentTimeService.cpp
+++ b/src/Components/Ble/CurrentTimeService.cpp
@@ -57,7 +57,7 @@
   return 0;
 }
 
-CurrentTimeService::CurrentTimeService(DateTime &dateTimeController) : m_dateTimeController{dateTimeController},
+CurrentTimeService::CurrentTimeService(DateTime &dateTimeController) :
         characteristicDefinition{
                 {
                         .uuid = (ble_uuid_t *) &ctChrUuid,
@@ -80,8 +80,7 @@                 },
                 {
                         0
                 },
-        }
-         {
+        }, m_dateTimeController{dateTimeController} {
 
 }
 




diff --git a/src/Components/Ble/DeviceInformationService.h b/src/Components/Ble/DeviceInformationService.h
index d768da8e53fe3558cc88741c8daa093fb789469f..7d7cea96edbfba85dfedc1b9e1ff57d0d15d4dee 100644
--- a/src/Components/Ble/DeviceInformationService.h
+++ b/src/Components/Ble/DeviceInformationService.h
@@ -22,11 +22,11 @@         static constexpr uint16_t serialNumberId {0x2a25};
         static constexpr uint16_t fwRevisionId {0x2a26};
         static constexpr uint16_t hwRevisionId {0x2a27};
 
-        static constexpr char* manufacturerName = "Codingfield";
-        static constexpr char* modelNumber = "1";
-        static constexpr char* serialNumber = "9.8.7.6.5.4";
-        static constexpr char* fwRevision = "0.7.0";
-        static constexpr char* hwRevision = "1.0.0";
+        static constexpr const char* manufacturerName = "Codingfield";
+        static constexpr const char* modelNumber = "1";
+        static constexpr const char* serialNumber = "9.8.7.6.5.4";
+        static constexpr const char* fwRevision = "0.7.0";
+        static constexpr const char* hwRevision = "1.0.0";
 
         static constexpr ble_uuid16_t deviceInfoUuid {
                 .u { .type = BLE_UUID_TYPE_16 },




diff --git a/src/Components/Ble/DfuService.cpp b/src/Components/Ble/DfuService.cpp
index c6d8493fde42242ef0f5381e537d83044db0b8e9..fcbefdd037591e22c34bd2dad04670b854aa47b7 100644
--- a/src/Components/Ble/DfuService.cpp
+++ b/src/Components/Ble/DfuService.cpp
@@ -394,14 +394,14 @@   spiNorFlash.Write(offset, reinterpret_cast(magic), 4 * sizeof(uint32_t));
 }
 
 void DfuService::DfuImage::Erase() {
-  for (int erased = 0; erased < maxSize; erased += 0x1000) {
+  for (size_t erased = 0; erased < maxSize; erased += 0x1000) {
     spiNorFlash.SectorErase(writeOffset + erased);
   }
 }
 
 bool DfuService::DfuImage::Validate() {
   uint32_t chunkSize = 200;
-  int currentOffset = 0;
+  size_t currentOffset = 0;
   uint16_t crc = 0;
 
   bool first = true;




diff --git a/src/Components/Ble/MusicService.cpp b/src/Components/Ble/MusicService.cpp
index 5ec766972986a400bca30d8f16b1d968699f6549..b5fa53562bd2fd054f370ab73adee332ad18e859 100644
--- a/src/Components/Ble/MusicService.cpp
+++ b/src/Components/Ble/MusicService.cpp
@@ -117,7 +117,6 @@
 void Pinetime::Controllers::MusicService::event(char event)
 {
     auto *om = ble_hs_mbuf_from_flat(&event, 1);
-    int ret;
 
     uint16_t connectionHandle = m_system.nimble().connHandle();
 
@@ -125,6 +124,6 @@     if (connectionHandle == 0 || connectionHandle == BLE_HS_CONN_HANDLE_NONE) {
         return;
     }
 
-    ret = ble_gattc_notify_custom(connectionHandle, m_eventHandle, om);
+    ble_gattc_notify_custom(connectionHandle, m_eventHandle, om);
 }
 




diff --git a/src/Components/Ble/NimbleController.cpp b/src/Components/Ble/NimbleController.cpp
index d7bbd8be1669359bf04136cfbc7aecf752501c9c..a865a82467b338f03a6b7327ca09aec6da230b62 100644
--- a/src/Components/Ble/NimbleController.cpp
+++ b/src/Components/Ble/NimbleController.cpp
@@ -139,14 +139,13 @@   rsp_fields.name = (uint8_t *)"Pinetime-JF";
   rsp_fields.name_len = strlen("Pinetime-JF");
   rsp_fields.name_is_complete = 1;
 
-  int res;
-  res = ble_gap_adv_set_fields(&fields);
+  ble_gap_adv_set_fields(&fields);
 //  ASSERT(res == 0); // TODO this one sometimes fails with error 22 (notsync)
 
-  res = ble_gap_adv_rsp_set_fields(&rsp_fields);
+  ble_gap_adv_rsp_set_fields(&rsp_fields);
 //  ASSERT(res == 0);
 
-  res = ble_gap_adv_start(addrType, NULL, 180000,
+  ble_gap_adv_start(addrType, NULL, 180000,
                           &adv_params, GAPEventCallback, this);
 //  ASSERT(res == 0);// TODO I've disabled these ASSERT as they sometime asserts and reset the mcu.
   // For now, the advertising is restarted as soon as it ends. There may be a race condition




diff --git a/src/Components/Ble/NimbleController.h b/src/Components/Ble/NimbleController.h
index dff93c8784f08fa16d3895882421465b9fbf20ac..49f4377b9fd3b1c4a09eb8d1fd4af21442542fae 100644
--- a/src/Components/Ble/NimbleController.h
+++ b/src/Components/Ble/NimbleController.h
@@ -43,7 +43,7 @@
         uint16_t connHandle();
 
       private:
-        static constexpr char* deviceName = "Pinetime-JF";
+        static constexpr const char* deviceName = "Pinetime-JF";
         Pinetime::System::SystemTask& systemTask;
         Pinetime::Controllers::Ble& bleController;
         DateTime& dateTimeController;




diff --git a/src/DisplayApp/DisplayApp.cpp b/src/DisplayApp/DisplayApp.cpp
index 935578070e44eed06fdbdc4348dae18074b76678..175bdc802d492a2aab7c8d7d08c8ef6faa2cdaef 100644
--- a/src/DisplayApp/DisplayApp.cpp
+++ b/src/DisplayApp/DisplayApp.cpp
@@ -79,6 +79,9 @@     case States::Running:
       RunningState();
       queueTimeout = 20;
       break;
+    default:
+      queueTimeout = portMAX_DELAY;
+      break;
   }
 
   Messages msg;




diff --git a/src/DisplayApp/DisplayApp.h b/src/DisplayApp/DisplayApp.h
index a6df95c19829c0cc3f2bc6a27030b1f1d80a2bd8..478953c8452667d28f3c346b1b4d269558dc49d8 100644
--- a/src/DisplayApp/DisplayApp.h
+++ b/src/DisplayApp/DisplayApp.h
@@ -30,11 +30,10 @@   namespace Applications {
     class DisplayApp {
       public:
         enum class States {Idle, Running};
-        enum class Messages : uint8_t {GoToSleep, GoToRunning, UpdateDateTime, UpdateBleConnection, UpdateBatteryLevel, TouchEvent, SwitchScreen,ButtonPushed,
-            NewNotification, BleFirmwareUpdateStarted, BleFirmwareUpdateFinished
-        };
+        enum class Messages : uint8_t {GoToSleep, GoToRunning, UpdateDateTime, UpdateBleConnection, UpdateBatteryLevel, TouchEvent, ButtonPushed,
+            NewNotification, BleFirmwareUpdateStarted };
+
         enum class FullRefreshDirections { None, Up, Down };
-
 
         DisplayApp(Drivers::St7789 &lcd, Components::LittleVgl &lvgl, Drivers::Cst816S &,
                    Controllers::Battery &batteryController, Controllers::Ble &bleController,




diff --git a/src/DisplayApp/LittleVgl.h b/src/DisplayApp/LittleVgl.h
index 8bd56ddf4193741ccea3df1b56f7bb431ed4da11..5c1c4434e485b6d9b91f3c4fceeb00d0702903bc 100644
--- a/src/DisplayApp/LittleVgl.h
+++ b/src/DisplayApp/LittleVgl.h
@@ -6,10 +6,6 @@ #include 
 #include <drivers/St7789.h>
 #include <drivers/Cst816s.h>
 
-
-static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p);
-static bool touchpad_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data);
-
 namespace Pinetime {
   namespace Components {
     class LittleVgl {




diff --git a/src/DisplayApp/Screens/Clock.cpp b/src/DisplayApp/Screens/Clock.cpp
index fc6441e83ac93c178394baab1246cf9f60abc6ef..06fab9aa6825350fe401c1427e67afd0ab7bafd1 100644
--- a/src/DisplayApp/Screens/Clock.cpp
+++ b/src/DisplayApp/Screens/Clock.cpp
@@ -121,13 +121,12 @@     auto dayOfWeek = static_cast(date::weekday(yearMonthDay).iso_encoding());
 
     auto hour = time.hours().count();
     auto minute = time.minutes().count();
-    auto second = time.seconds().count();
 
     char minutesChar[3];
-    sprintf(minutesChar, "%02d", minute);
+    sprintf(minutesChar, "%02d", static_cast<int>(minute));
 
     char hoursChar[3];
-    sprintf(hoursChar, "%02d", hour);
+    sprintf(hoursChar, "%02d", static_cast<int>(hour));
 
     char timeStr[6];
     sprintf(timeStr, "%c%c:%c%c", hoursChar[0],hoursChar[1],minutesChar[0], minutesChar[1]);




diff --git a/src/DisplayApp/Screens/FirmwareValidation.cpp b/src/DisplayApp/Screens/FirmwareValidation.cpp
index 70d325755af6e4323cee5aab1321c049501dfd03..fb2dd956a27096e2b706a0683dfc45173757489a 100644
--- a/src/DisplayApp/Screens/FirmwareValidation.cpp
+++ b/src/DisplayApp/Screens/FirmwareValidation.cpp
@@ -29,7 +29,7 @@
   labelVersionValue = lv_label_create(lv_scr_act(), NULL);
   lv_obj_align(labelVersionValue, labelVersionInfo, LV_ALIGN_OUT_RIGHT_MID, 0, 0);
   lv_label_set_recolor(labelVersionValue, true);
-  sprintf(version, "%d.%d.%d", Version::Major(), Version::Minor(), Version::Patch());
+  sprintf(version, "%ld.%ld.%ld", Version::Major(), Version::Minor(), Version::Patch());
   lv_label_set_text(labelVersionValue, version);
 
   labelIsValidated = lv_label_create(lv_scr_act(), NULL);




diff --git a/src/DisplayApp/Screens/Message.cpp b/src/DisplayApp/Screens/Message.cpp
deleted file mode 100644
index b83cb7519a56936764d226a2ad5cb766ee8e6227..0000000000000000000000000000000000000000
--- a/src/DisplayApp/Screens/Message.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-#include <cstdio>
-#include <libs/date/includes/date/date.h>
-#include <Components/DateTime/DateTimeController.h>
-#include <Version.h>
-#include <libs/lvgl/src/lv_core/lv_obj.h>
-#include <libs/lvgl/src/lv_font/lv_font.h>
-#include <libs/lvgl/lvgl.h>
-#include <libraries/log/nrf_log.h>
-#include "Message.h"
-#include <DisplayApp/DisplayApp.h>
-
-
-using namespace Pinetime::Applications::Screens;
-
-extern lv_font_t jetbrains_mono_bold_20;
-
-static void event_handler(lv_obj_t * obj, lv_event_t event) {
-  Message* screen = static_cast<Message *>(obj->user_data);
-  screen->OnObjectEvent(obj, event);
-}
-
-Message::Message(DisplayApp* app) : Screen(app) {
-
-  backgroundLabel = lv_label_create(lv_scr_act(), NULL);
-  backgroundLabel->user_data = this;
-
-  lv_obj_set_click(backgroundLabel, true);
-  lv_obj_set_event_cb(backgroundLabel, event_handler);
-  lv_label_set_long_mode(backgroundLabel, LV_LABEL_LONG_CROP);
-  lv_obj_set_size(backgroundLabel, 240, 240);
-  lv_obj_set_pos(backgroundLabel, 0, 0);
-  lv_label_set_text(backgroundLabel, "");
-
-  button = lv_btn_create(lv_scr_act(), NULL);
-  lv_obj_set_event_cb(button, event_handler);
-  lv_obj_align(button, NULL, LV_ALIGN_CENTER, 0, -40);
-  button->user_data = this;
-
-  label = lv_label_create(button, NULL);
-  lv_label_set_text(label, "Hello!");
-
-  labelClick = lv_label_create(lv_scr_act(), NULL);
-  lv_obj_align(labelClick, button, LV_ALIGN_OUT_BOTTOM_MID, 0, 30);
-  lv_label_set_text(labelClick, "0");
-}
-
-Message::~Message() {
-  lv_obj_clean(lv_scr_act());
-}
-
-bool Message::Refresh() {
-  if(previousClickCount != clickCount) {
-    lv_label_set_text_fmt(labelClick, "%d", clickCount);
-    previousClickCount = clickCount;
-  }
-
-  return running;
-}
-
-void Message::OnObjectEvent(lv_obj_t *obj, lv_event_t event) {
-  if(obj == backgroundLabel) {
-    if(event == LV_EVENT_CLICKED) {
-      app->PushMessage(DisplayApp::Messages::SwitchScreen);
-      NRF_LOG_INFO("SCREEN");
-    }
-    return ;
-  }
-
-  if(event == LV_EVENT_CLICKED) {
-    NRF_LOG_INFO("Clicked");
-    clickCount++;
-  }
-  else if(event == LV_EVENT_VALUE_CHANGED) {
-    NRF_LOG_INFO("Toggled");
-  }
-}
-
-bool Message::OnButtonPushed() {
-  running = false;
-  return true;
-}




diff --git a/src/DisplayApp/Screens/Message.h b/src/DisplayApp/Screens/Message.h
deleted file mode 100644
index 3ace66fe7ceaf57671ab1e4eb9cd654ab4aafa17..0000000000000000000000000000000000000000
--- a/src/DisplayApp/Screens/Message.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#pragma once
-
-#include <cstdint>
-#include "Screen.h"
-#include <bits/unique_ptr.h>
-#include <lvgl/src/lv_core/lv_style.h>
-
-namespace Pinetime {
-  namespace Applications {
-    namespace Screens {
-      class Message : public Screen{
-        public:
-          explicit Message(DisplayApp* app);
-          ~Message() override;
-          bool Refresh() override;
-          bool OnButtonPushed();
-          void OnObjectEvent(lv_obj_t* obj, lv_event_t event);
-
-        private:
-          lv_obj_t * label;
-          lv_obj_t* backgroundLabel;
-          lv_obj_t * button;
-          lv_obj_t * labelClick;
-
-          uint32_t clickCount = 0 ;
-          uint32_t previousClickCount = 0;
-          bool running = true;
-      };
-    }
-  }
-}




diff --git a/src/DisplayApp/Screens/Symbols.h b/src/DisplayApp/Screens/Symbols.h
index 54c3f8f02b39b75667fc566e0b5534f5af82d90d..69078c8a93afa2533fb629d6b292ac11e497e8be 100644
--- a/src/DisplayApp/Screens/Symbols.h
+++ b/src/DisplayApp/Screens/Symbols.h
@@ -4,25 +4,25 @@ namespace Pinetime {
   namespace Applications {
     namespace Screens {
       namespace Symbols {
-        static constexpr char* none = "";
-        static constexpr char* batteryFull = "\xEF\x89\x80";
-        static constexpr char* batteryEmpty = "\xEF\x89\x84";
-        static constexpr char* batteryThreeQuarter = "\xEF\x89\x81";
-        static constexpr char* batteryHalf = "\xEF\x89\x82";
-        static constexpr char* batteryOneQuarter = "\xEF\x89\x83";
-        static constexpr char* heartBeat = "\xEF\x88\x9E";
-        static constexpr char* bluetoothFull = "\xEF\x8A\x93";
-        static constexpr char* bluetooth = "\xEF\x8A\x94";
-        static constexpr char* plug = "\xEF\x87\xA6";
-        static constexpr char* shoe = "\xEF\x95\x8B";
-        static constexpr char* clock = "\xEF\x80\x97";
-        static constexpr char* info = "\xEF\x84\xA9";
-        static constexpr char* list = "\xEF\x80\xBA";
-        static constexpr char* sun = "\xEF\x86\x85";
-        static constexpr char* check = "\xEF\x95\xA0";
-        static constexpr char* music = "\xEF\x80\x81";
-        static constexpr char* tachometer = "\xEF\x8F\xBD";
-        static constexpr char* asterisk = "\xEF\x81\xA9";
+        static constexpr const char* none = "";
+        static constexpr const char* batteryFull = "\xEF\x89\x80";
+        static constexpr const char* batteryEmpty = "\xEF\x89\x84";
+        static constexpr const char* batteryThreeQuarter = "\xEF\x89\x81";
+        static constexpr const char* batteryHalf = "\xEF\x89\x82";
+        static constexpr const char* batteryOneQuarter = "\xEF\x89\x83";
+        static constexpr const char* heartBeat = "\xEF\x88\x9E";
+        static constexpr const char* bluetoothFull = "\xEF\x8A\x93";
+        static constexpr const char* bluetooth = "\xEF\x8A\x94";
+        static constexpr const char* plug = "\xEF\x87\xA6";
+        static constexpr const char* shoe = "\xEF\x95\x8B";
+        static constexpr const char* clock = "\xEF\x80\x97";
+        static constexpr const char* info = "\xEF\x84\xA9";
+        static constexpr const char* list = "\xEF\x80\xBA";
+        static constexpr const char* sun = "\xEF\x86\x85";
+        static constexpr const char* check = "\xEF\x95\xA0";
+        static constexpr const char* music = "\xEF\x80\x81";
+        static constexpr const char* tachometer = "\xEF\x8F\xBD";
+        static constexpr const char* asterisk = "\xEF\x81\xA9";
       }
     }
   }




diff --git a/src/DisplayApp/Screens/SystemInfo.cpp b/src/DisplayApp/Screens/SystemInfo.cpp
index b355f41929793a41674c1eceafd7d24b551a3a3b..ef55eb5ffb18abde3f3433106214e4efe581614a 100644
--- a/src/DisplayApp/Screens/SystemInfo.cpp
+++ b/src/DisplayApp/Screens/SystemInfo.cpp
@@ -49,6 +49,7 @@   else if(batteryPercent < 0) batteryPercent = 0;
 
   uint8_t brightness = 0;
   switch(brightnessController.Level()) {
+    case Controllers::BrightnessController::Levels::Off: brightness = 0; break;
     case Controllers::BrightnessController::Levels::Low: brightness = 1; break;
     case Controllers::BrightnessController::Levels::Medium: brightness = 2; break;
     case Controllers::BrightnessController::Levels::High: brightness = 3; break;
@@ -82,10 +83,10 @@   uptimeSeconds = uptimeSeconds % secondsInAMinute;
   // TODO handle more than 100 days of uptime
 
   sprintf(t1, "Pinetime\n"
-              "Version:%d.%d.%d\n"
+              "Version:%ld.%ld.%ld\n"
               "Build: %s\n"
               "       %s\n"
-              "Date: %02d/%02d/%04d\n"
+              "Date: %02d/%02hhu/%04d\n"
               "Time: %02d:%02d:%02d\n"
               "Uptime: %02lud %02lu:%02lu:%02lu\n"
               "Battery: %d%%\n"
@@ -93,7 +94,7 @@               "Backlight: %d/3\n"
               "Last reset: %s\n",
           Version::Major(), Version::Minor(), Version::Patch(),
           __DATE__, __TIME__,
-          dateTimeController.Day(), dateTimeController.Month(), dateTimeController.Year(),
+          dateTimeController.Day(), static_cast<uint8_t>(dateTimeController.Month()), dateTimeController.Year(),
           dateTimeController.Hours(), dateTimeController.Minutes(), dateTimeController.Seconds(),
           uptimeDays, uptimeHours, uptimeMinutes, uptimeSeconds,
           batteryPercent, brightness, resetReason);




diff --git a/src/DisplayApp/Screens/Tile.cpp b/src/DisplayApp/Screens/Tile.cpp
index 5d4da2cfdcf9c69b9db672541323ce5208366777..1447d789be2b499c1397427363afd3c2e9124068 100644
--- a/src/DisplayApp/Screens/Tile.cpp
+++ b/src/DisplayApp/Screens/Tile.cpp
@@ -46,7 +46,6 @@   return running;
 }
 
 void Tile::OnObjectEvent(lv_obj_t *obj, lv_event_t event, uint32_t buttonId) {
-  auto* tile = static_cast<Tile*>(obj->user_data);
   if(event == LV_EVENT_VALUE_CHANGED) {
     app->StartApp(apps[buttonId]);
     running = false;




diff --git a/src/SystemTask/SystemMonitor.h b/src/SystemTask/SystemMonitor.h
index 8fcfafb2ab43f60fc0bb04fd8be465cfa1181bcb..ec1fd817a035ecf3f55cdac3b02ecff686431f82 100644
--- a/src/SystemTask/SystemMonitor.h
+++ b/src/SystemTask/SystemMonitor.h
@@ -28,7 +28,7 @@         void Process() const {
           if(xTaskGetTickCount() - lastTick > 10000) {
             NRF_LOG_INFO("---------------------------------------\nFree heap : %d", xPortGetFreeHeapSize());
             auto nb = uxTaskGetSystemState(tasksStatus, 10, NULL);
-            for (int i = 0; i < nb; i++) {
+            for (uint32_t i = 0; i < nb; i++) {
               NRF_LOG_INFO("Task [%s] - %d", tasksStatus[i].pcTaskName, tasksStatus[i].usStackHighWaterMark);
               if (tasksStatus[i].usStackHighWaterMark < 20)
                 NRF_LOG_INFO("WARNING!!! Task %s task is nearly full, only %dB available", tasksStatus[i].pcTaskName,




diff --git a/src/SystemTask/SystemTask.cpp b/src/SystemTask/SystemTask.cpp
index d4b78187d959ee03a28e4862297b0669e3e0c89a..1ee8e9184c43f8aff205bd074264b6351daf78cf 100644
--- a/src/SystemTask/SystemTask.cpp
+++ b/src/SystemTask/SystemTask.cpp
@@ -136,7 +136,6 @@           break;
         case Messages::BleFirmwareUpdateFinished:
           doNotGoToSleep = false;
           xTimerStart(idleTimer, 0);
-          displayApp->PushMessage(Pinetime::Applications::DisplayApp::Messages::BleFirmwareUpdateFinished);
           if(bleController.State() == Pinetime::Controllers::Ble::FirmwareUpdateStates::Validated)
             NVIC_SystemReset();
           break;




diff --git a/src/drivers/Cst816s.cpp b/src/drivers/Cst816s.cpp
index 60cd402cbc421a112f5ccfb44ca0c057f2cf8f61..6afbf734ba4864bda06c57ef501d342433d58c0f 100644
--- a/src/drivers/Cst816s.cpp
+++ b/src/drivers/Cst816s.cpp
@@ -60,9 +60,9 @@     auto yLow = touchData[touchYLowIndex + (touchStep * i)];
     uint16_t y = (yHigh << 8) | yLow;
 
     auto action = touchData[touchEventIndex + (touchStep * i)] >> 6; /* 0 = Down, 1 = Up, 2 = contact*/
-    auto finger = touchData[touchIdIndex + (touchStep * i)] >> 4;
-    auto pressure = touchData[touchXYIndex + (touchStep * i)];
-    auto area = touchData[touchMiscIndex + (touchStep * i)] >> 4;
+    //auto finger = touchData[touchIdIndex + (touchStep * i)] >> 4;
+    //auto pressure = touchData[touchXYIndex + (touchStep * i)];
+    //auto area = touchData[touchMiscIndex + (touchStep * i)] >> 4;
 
     info.x = x;
     info.y = y;
@@ -89,7 +89,6 @@ //      case Gestures::DoubleTap: NRF_LOG_INFO("Gesture : Double click"); break;
 //      case Gestures::LongPress: NRF_LOG_INFO("Gesture : Long press"); break;
 //      default : NRF_LOG_INFO("Unknown"); break;
 //    }
-
   }
 
 




diff --git a/src/drivers/SpiMaster.cpp b/src/drivers/SpiMaster.cpp
index 8087d386fabd998a71b9650b5fd502be4448fad3..8d36b9cdb2d4e1af8c3d521e41210637fae46161 100644
--- a/src/drivers/SpiMaster.cpp
+++ b/src/drivers/SpiMaster.cpp
@@ -117,8 +117,6 @@     currentBufferSize -= currentSize;
 
     spiBaseAddress->TASKS_START = 1;
   } else {
-    uint8_t* buffer = nullptr;
-    size_t size = 0;
       if(taskToNotify != nullptr) {
           BaseType_t xHigherPriorityTaskWoken = pdFALSE;
           vTaskNotifyGiveFromISR(taskToNotify, &xHigherPriorityTaskWoken);




diff --git a/src/graphics.cpp b/src/graphics.cpp
index 3b53703cc35698839c2fcaebbcf32541956404d4..b8376d6dde52f2ff26c9d806c2b9bafa4809e5c2 100644
--- a/src/graphics.cpp
+++ b/src/graphics.cpp
@@ -103,10 +103,10 @@   NRF_LOG_INFO("Read memory and display the graphic...");
   static constexpr uint32_t screenWidth = 240;
   static constexpr uint32_t screenWidthInBytes = screenWidth*2; // LCD display 16bits color (1 pixel = 2 bytes)
   uint16_t displayLineBuffer[screenWidth];
-  for(int line = 0; line < screenWidth; line++) {
+  for(uint32_t line = 0; line < screenWidth; line++) {
     spiNorFlash.Read(line*screenWidthInBytes, reinterpret_cast<uint8_t *>(displayLineBuffer), screenWidth);
     spiNorFlash.Read((line*screenWidthInBytes)+screenWidth, reinterpret_cast<uint8_t *>(displayLineBuffer) + screenWidth, screenWidth);
-    for(int col = 0; col < screenWidth; col++) {
+    for(uint32_t col = 0; col < screenWidth; col++) {
       gfx.pixel_draw(col, line, displayLineBuffer[col]);
     }
   }




diff --git a/src/libs/mynewt-nimble/nimble/host/src/ble_gap.c b/src/libs/mynewt-nimble/nimble/host/src/ble_gap.c
index be4a1cb338176b1a8cd7a6f6e4000635171e00ac..e32482e6ef3c078570c17ed222667f061d6a0190 100644
--- a/src/libs/mynewt-nimble/nimble/host/src/ble_gap.c
+++ b/src/libs/mynewt-nimble/nimble/host/src/ble_gap.c
@@ -310,12 +310,14 @@         BLE_HS_LOG(INFO, "peer_addr_type=%d peer_addr=", peer_addr->type);
         BLE_HS_LOG_ADDR(INFO, peer_addr->val);
     }
 
+    /* // NRF LOG support max 6 params in log
     BLE_HS_LOG(INFO, " scan_itvl=%d scan_window=%d itvl_min=%d itvl_max=%d "
                      "latency=%d supervision_timeout=%d min_ce_len=%d "
                      "max_ce_len=%d own_addr_type=%d",
                params->scan_itvl, params->scan_window, params->itvl_min,
                params->itvl_max, params->latency, params->supervision_timeout,
                params->min_ce_len, params->max_ce_len, own_addr_type);
+     */
 }
 #endif