From 32fada34f4ebd0805c6c097ad4c7d5237e20eb61 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Mon, 27 Feb 2023 22:03:01 +0100 Subject: [PATCH] Support rename of TimerController to FreeRTOS::Timer --- CMakeLists.txt | 15 +++++++++++++-- main.cpp | 7 +++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49cd262..f2f1ba2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,8 +196,6 @@ target_sources(infinisim PUBLIC ${InfiniTime_DIR}/src/components/fs/FS.cpp ${InfiniTime_DIR}/src/components/motor/MotorController.h ${InfiniTime_DIR}/src/components/motor/MotorController.cpp - ${InfiniTime_DIR}/src/components/timer/TimerController.h - ${InfiniTime_DIR}/src/components/timer/TimerController.cpp ${InfiniTime_DIR}/src/drivers/PinMap.h ${InfiniTime_DIR}/src/drivers/Spi.h ${InfiniTime_DIR}/src/drivers/Spi.cpp @@ -216,6 +214,19 @@ target_sources(infinisim PUBLIC ${InfiniTime_DIR}/src/displayapp/InfiniTimeTheme.h ) +if(EXISTS ${InfiniTime_DIR}/src/wrappers/FreeRTOS/Timer.h) + target_sources(infinisim PUBLIC + ${InfiniTime_DIR}/src/wrappers/FreeRTOS/Timer.h + ${InfiniTime_DIR}/src/wrappers/FreeRTOS/Timer.cpp + ) +else() + target_compile_definitions(infinisim PUBLIC INFINITIME_TIMERCONTROLLER) + target_sources(infinisim PUBLIC + ${InfiniTime_DIR}/src/components/timer/TimerController.h + ${InfiniTime_DIR}/src/components/timer/TimerController.cpp + ) +endif() + # littlefs add_library(littlefs STATIC ${InfiniTime_DIR}/src/libs/littlefs/lfs_util.h diff --git a/main.cpp b/main.cpp index cd61ae9..b679d27 100644 --- a/main.cpp +++ b/main.cpp @@ -345,7 +345,10 @@ Pinetime::Controllers::DateTime dateTimeController {settingsController}; Pinetime::Drivers::Watchdog watchdog; Pinetime::Controllers::NotificationManager notificationManager; Pinetime::Controllers::MotionController motionController; +#if defined(INFINITIME_TIMERCONTROLLER) Pinetime::Controllers::TimerController timerController; +#endif + Pinetime::Controllers::AlarmController alarmController {dateTimeController}; Pinetime::Controllers::TouchHandler touchHandler; Pinetime::Controllers::ButtonHandler buttonHandler; @@ -362,7 +365,9 @@ Pinetime::Applications::DisplayApp displayApp(lcd, settingsController, motorController, motionController, + #if defined(INFINITIME_TIMERCONTROLLER) timerController, + #endif alarmController, brightnessController, touchHandler, @@ -375,7 +380,9 @@ Pinetime::System::SystemTask systemTask(spi, batteryController, bleController, dateTimeController, + #if defined(INFINITIME_TIMERCONTROLLER) timerController, + #endif alarmController, watchdog, notificationManager,