Skip to content

Commit

Permalink
Support "Centralize most color definitions"
Browse files Browse the repository at this point in the history
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
  • Loading branch information
NeroBurner committed Aug 15, 2022
1 parent 8861b98 commit c139cbf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
14 changes: 12 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,6 @@ target_sources(infinisim PUBLIC
${InfiniTime_DIR}/src/displayapp/Colors.cpp
${InfiniTime_DIR}/src/displayapp/DisplayApp.h
${InfiniTime_DIR}/src/displayapp/DisplayApp.cpp
${InfiniTime_DIR}/src/displayapp/lv_pinetime_theme.h
${InfiniTime_DIR}/src/displayapp/lv_pinetime_theme.c
${InfiniTime_DIR}/src/displayapp/icons/bg_clock.c # used by WatchFaceAnalog.cpp
${InfiniTime_DIR}/src/buttonhandler/ButtonHandler.h
${InfiniTime_DIR}/src/buttonhandler/ButtonHandler.cpp
Expand Down Expand Up @@ -231,6 +229,18 @@ target_sources(infinisim PUBLIC
${InfiniTime_DIR}/src/systemtask/SystemMonitor.cpp
)

if(EXISTS ${InfiniTime_DIR}/src/displayapp/InfiniTimeTheme.cpp)
target_compile_definitions(infinisim PUBLIC INFINITIME_THEME_CPP)
target_sources(infinisim PUBLIC
${InfiniTime_DIR}/src/displayapp/InfiniTimeTheme.cpp
${InfiniTime_DIR}/src/displayapp/InfiniTimeTheme.h
)
else()
target_sources(infinisim PUBLIC
${InfiniTime_DIR}/src/displayapp/lv_pinetime_theme.h
${InfiniTime_DIR}/src/displayapp/lv_pinetime_theme.c
)
endif()

# QCBOR
add_library(QCBOR STATIC
Expand Down
4 changes: 4 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
#include "lv_drivers/indev/mousewheel.h"

// get PineTime header
#if defined(INFINITIME_THEME_CPP)
#include "displayapp/InfiniTimeTheme.h"
#else
#include "displayapp/lv_pinetime_theme.h"
#endif
#include <drivers/Hrs3300.h>
#include <drivers/Bma421.h>

Expand Down
4 changes: 4 additions & 0 deletions sim/displayapp/LittleVgl.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#include "displayapp/LittleVgl.h"
#if defined(INFINITIME_THEME_CPP)
#include "displayapp/InfiniTimeTheme.h"
#else
#include "displayapp/lv_pinetime_theme.h"
#endif

#include <FreeRTOS.h>
#include <task.h>
Expand Down

0 comments on commit c139cbf

Please sign in to comment.