Skip to content

Commit

Permalink
fix for sim build
Browse files Browse the repository at this point in the history
  • Loading branch information
KenVanHoeylandt committed Jan 24, 2024
1 parent ebd2686 commit c44b251
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ add_subdirectory(libs/mlib)
add_subdirectory(tactility)
add_subdirectory(tactility-core)

if (NOT $ENV{ESP_IDF_VERSION})
if (NOT DEFINED $ENV{ESP_IDF_VERSION})
add_subdirectory(libs/freertos-kernel)
target_include_directories(freertos-kernel
PUBLIC app-sim/src # for FreeRTOSConfig.h
Expand Down
16 changes: 16 additions & 0 deletions app-sim/src/hardware_config.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Placeholder hardware config.
* The real one happens during FreeRTOS startup. See freertos.c and lvgl_*.c
*/
#include <stdbool.h>
#include "hardware_config.h"


// TODO: See if we can move the init from FreeRTOS to app_main()?
static bool init_lvgl() { return true; }

HardwareConfig sim_hardware = {
.bootstrap = NULL,
.init_lvgl = &init_lvgl,
};

3 changes: 3 additions & 0 deletions app-sim/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@

#define TAG "main"

extern HardwareConfig sim_hardware;

_Noreturn void app_main() {
static const Config config = {
.hardware = &sim_hardware,
.apps = {
&hello_world_app
},
Expand Down
2 changes: 1 addition & 1 deletion tactility-core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ target_include_directories(tactility-core SYSTEM
INTERFACE src/
)

if (ESP_PLATFORM)
if ($ENV{ESP_IDF_VERSION})
add_definitions(-DESP_PLATFORM)
target_link_libraries(tactility-core
PUBLIC mlib
Expand Down
2 changes: 1 addition & 1 deletion tactility/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ target_include_directories(tactility
INTERFACE src/
)

if (ESP_PLATFORM)
if ($ENV{ESP_IDF_VERSION})
add_definitions(-DESP_PLATFORM)
target_link_libraries(tactility
PUBLIC tactility-core
Expand Down

0 comments on commit c44b251

Please sign in to comment.