Support for building and running external apps (#112)
This commit is contained in:
committed by
GitHub
parent
42e843b463
commit
415442e410
@@ -0,0 +1,17 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
set(TACTILITY_SKIP_SPIFFS 1)
|
||||
add_definitions(-DESP_TARGET)
|
||||
add_compile_definitions(ESP_TARGET)
|
||||
|
||||
add_definitions(-DLV_CONF_PATH=../../../Boards/Simulator/Source/lv_conf.h)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
|
||||
set(EXTRA_COMPONENT_DIRS "../../Libraries/elf_loader")
|
||||
|
||||
project(HelloWorld)
|
||||
|
||||
include(elf_loader)
|
||||
project_elf(HelloWorld)
|
||||
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
rm sdkconfig
|
||||
cp ../../sdkconfig sdkconfig
|
||||
cat sdkconfig.override >> sdkconfig
|
||||
idf.py build
|
||||
@@ -0,0 +1,16 @@
|
||||
file(GLOB_RECURSE SOURCE_FILES Source/*.c)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
)
|
||||
|
||||
add_prebuilt_library(Tactility ../../../build/esp-idf/Tactility/libTactility.a)
|
||||
add_prebuilt_library(TactilityC ../../../build/esp-idf/TactilityC/libTactilityC.a)
|
||||
add_prebuilt_library(TactilityCore ../../../build/esp-idf/TactilityCore/libTactilityCore.a)
|
||||
add_prebuilt_library(TactilityHeadless ../../../build/esp-idf/TactilityHeadless/libTactilityHeadless.a)
|
||||
add_prebuilt_library(lvgl ../../../build/esp-idf/lvgl/liblvgl.a)
|
||||
|
||||
include_directories("../../../TactilityC/Source")
|
||||
include_directories("../../../Libraries/lvgl/src")
|
||||
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE TactilityC Tactility TactilityCore TactilityHeadless lvgl)
|
||||
@@ -0,0 +1,29 @@
|
||||
#include <stddef.h>
|
||||
#include "TactilityC/app/App.h"
|
||||
#include "TactilityC/lvgl/Toolbar.h"
|
||||
|
||||
/**
|
||||
* Note: LVGL and Tactility methods need to be exposed manually from TactilityC/Source/TactilityC.cpp
|
||||
* Only C is supported for now (C++ symbols fail to link)
|
||||
*/
|
||||
static void onShow(AppContextHandle context, lv_obj_t* parent) {
|
||||
lv_obj_t* toolbar = tt_lvgl_toolbar_create(parent, context);
|
||||
lv_obj_align(toolbar, LV_ALIGN_TOP_MID, 0, 0);
|
||||
|
||||
lv_obj_t* label = lv_label_create(parent);
|
||||
lv_label_set_text(label, "Hello, world!");
|
||||
lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
tt_set_app_manifest(
|
||||
"Hello World",
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
onShow,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
CONFIG_PARTITION_TABLE_SINGLE_APP=y
|
||||
Reference in New Issue
Block a user