Skip to content

Commit b00dceb

Browse files
authored
Support "Centralize most color definitions" (#50)
Support changes in InfiniTimeOrg/InfiniTime#1258 The file `lv_pinetime_theme.c` is renamed to `InfiniTimeTheme.cpp`. Need to pick up that change in the simulator to compile with the new cpp file if it exists. Furthermore use the new `InfiniTimeTheme.h` header in simulator files. Fixes: #49
1 parent fc96e5d commit b00dceb

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,6 @@ target_sources(infinisim PUBLIC
197197
${InfiniTime_DIR}/src/displayapp/Colors.cpp
198198
${InfiniTime_DIR}/src/displayapp/DisplayApp.h
199199
${InfiniTime_DIR}/src/displayapp/DisplayApp.cpp
200-
${InfiniTime_DIR}/src/displayapp/lv_pinetime_theme.h
201-
${InfiniTime_DIR}/src/displayapp/lv_pinetime_theme.c
202200
${InfiniTime_DIR}/src/displayapp/icons/bg_clock.c # used by WatchFaceAnalog.cpp
203201
${InfiniTime_DIR}/src/buttonhandler/ButtonHandler.h
204202
${InfiniTime_DIR}/src/buttonhandler/ButtonHandler.cpp
@@ -231,6 +229,18 @@ target_sources(infinisim PUBLIC
231229
${InfiniTime_DIR}/src/systemtask/SystemMonitor.cpp
232230
)
233231

232+
if(EXISTS ${InfiniTime_DIR}/src/displayapp/InfiniTimeTheme.cpp)
233+
target_compile_definitions(infinisim PUBLIC INFINITIME_THEME_CPP)
234+
target_sources(infinisim PUBLIC
235+
${InfiniTime_DIR}/src/displayapp/InfiniTimeTheme.cpp
236+
${InfiniTime_DIR}/src/displayapp/InfiniTimeTheme.h
237+
)
238+
else()
239+
target_sources(infinisim PUBLIC
240+
${InfiniTime_DIR}/src/displayapp/lv_pinetime_theme.h
241+
${InfiniTime_DIR}/src/displayapp/lv_pinetime_theme.c
242+
)
243+
endif()
234244

235245
# QCBOR
236246
add_library(QCBOR STATIC

main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@
2121
#include "lv_drivers/indev/mousewheel.h"
2222

2323
// get PineTime header
24+
#if defined(INFINITIME_THEME_CPP)
25+
#include "displayapp/InfiniTimeTheme.h"
26+
#else
2427
#include "displayapp/lv_pinetime_theme.h"
28+
#endif
2529
#include <drivers/Hrs3300.h>
2630
#include <drivers/Bma421.h>
2731

sim/displayapp/LittleVgl.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#include "displayapp/LittleVgl.h"
2+
#if defined(INFINITIME_THEME_CPP)
3+
#include "displayapp/InfiniTimeTheme.h"
4+
#else
25
#include "displayapp/lv_pinetime_theme.h"
6+
#endif
37

48
#include <FreeRTOS.h>
59
#include <task.h>

0 commit comments

Comments
 (0)