diff --git a/App/Source/HelloWorld/HelloWorld.cpp b/App/Source/HelloWorld/HelloWorld.cpp deleted file mode 100644 index ddd7d1c2..00000000 --- a/App/Source/HelloWorld/HelloWorld.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include -#include - -using namespace tt::app; - -class HelloWorldApp : public App { - - void onShow(AppContext& context, lv_obj_t* parent) override { - 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); - } -}; - -extern const AppManifest hello_world_app = { - .appId = "HelloWorld", - .appName = "Hello World", - .createApp = create -}; diff --git a/Buildscripts/board.cmake b/Buildscripts/board.cmake index d317df60..e2c340fb 100644 --- a/Buildscripts/board.cmake +++ b/Buildscripts/board.cmake @@ -24,9 +24,9 @@ function(INIT_TACTILITY_GLOBALS SDKCONFIG_FILE) if (board_id STREQUAL "cyd-2432s024c") set(TACTILITY_BOARD_PROJECT CYD-2432S024C) elseif (board_id STREQUAL "cyd-2432s028r") - set(TACTILITY_BOARD_PROJECT CYD-2432S028R) + set(TACTILITY_BOARD_PROJECT CYD-2432S028R) elseif (board_id STREQUAL "cyd-e32r28t") - set(TACTILITY_BOARD_PROJECT CYD-E32R28T) + set(TACTILITY_BOARD_PROJECT CYD-E32R28T) elseif (board_id STREQUAL "cyd-2432s032c") set(TACTILITY_BOARD_PROJECT CYD-2432S032C) elseif (board_id STREQUAL "cyd-4848s040c") diff --git a/CMakeLists.txt b/CMakeLists.txt index d388273e..9f3d735d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,9 +29,9 @@ if (DEFINED ENV{ESP_IDF_VERSION}) init_tactility_globals("sdkconfig") get_property(TACTILITY_BOARD_PROJECT GLOBAL PROPERTY TACTILITY_BOARD_PROJECT) - set(COMPONENTS App) + set(COMPONENTS Firmware) set(EXTRA_COMPONENT_DIRS - "App" + "Firmware" "Boards/${TACTILITY_BOARD_PROJECT}" "Drivers" "Tactility" @@ -93,7 +93,7 @@ if (NOT DEFINED ENV{ESP_IDF_VERSION}) add_subdirectory(Libraries/mbedtls) # Sim app - add_subdirectory(App) + add_subdirectory(Firmware) # Tests add_subdirectory(Tests) diff --git a/App/CMakeLists.txt b/Firmware/CMakeLists.txt similarity index 81% rename from App/CMakeLists.txt rename to Firmware/CMakeLists.txt index e432c879..864bec8a 100644 --- a/App/CMakeLists.txt +++ b/Firmware/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.20) +file(GLOB_RECURSE SOURCE_FILES "Source/*.c*") + if (DEFINED ENV{ESP_IDF_VERSION}) # Read board id/project include("../Buildscripts/board.cmake") @@ -7,15 +9,13 @@ if (DEFINED ENV{ESP_IDF_VERSION}) get_property(TACTILITY_BOARD_PROJECT GLOBAL PROPERTY TACTILITY_BOARD_PROJECT) idf_component_register( - SRC_DIRS "Source" - "Source/HelloWorld" + SRCS ${SOURCE_FILES} REQUIRES ${BOARD_COMPONENTS} REQUIRES Tactility TactilityC ${TACTILITY_BOARD_PROJECT} ) else () - file(GLOB_RECURSE SOURCES "Source/*.c*") - add_executable(AppSim ${SOURCES}) + add_executable(AppSim ${SOURCE_FILES}) target_link_libraries(AppSim PRIVATE Tactility PRIVATE TactilityCore diff --git a/App/Kconfig b/Firmware/Kconfig similarity index 100% rename from App/Kconfig rename to Firmware/Kconfig diff --git a/App/Source/Boards.h b/Firmware/Source/Boards.h similarity index 100% rename from App/Source/Boards.h rename to Firmware/Source/Boards.h diff --git a/App/Source/Main.cpp b/Firmware/Source/Main.cpp similarity index 82% rename from App/Source/Main.cpp rename to Firmware/Source/Main.cpp index dd7e7203..5da5ae49 100644 --- a/App/Source/Main.cpp +++ b/Firmware/Source/Main.cpp @@ -15,10 +15,7 @@ void app_main() { * Auto-select a board based on the ./sdkconfig.board.* file * that you copied to ./sdkconfig before you opened this project. */ - .hardware = TT_BOARD_HARDWARE, - .apps = { - // &hello_world_app, - } + .hardware = TT_BOARD_HARDWARE }; #ifdef ESP_PLATFORM diff --git a/App/idf_component.yml b/Firmware/idf_component.yml similarity index 100% rename from App/idf_component.yml rename to Firmware/idf_component.yml diff --git a/Tactility/Include/Tactility/Tactility.h b/Tactility/Include/Tactility/Tactility.h index 067a017e..d3168bee 100644 --- a/Tactility/Include/Tactility/Tactility.h +++ b/Tactility/Include/Tactility/Tactility.h @@ -15,10 +15,6 @@ namespace app::launcher { extern const AppManifest manifest; } struct Configuration { /** HAL configuration (drivers) */ const hal::Configuration* hardware = nullptr; - /** List of user applications */ - const std::vector apps = {}; - /** List of user services */ - const std::vector services = {}; }; /** diff --git a/Tactility/Source/Tactility.cpp b/Tactility/Source/Tactility.cpp index f88c0a23..7e8ffa29 100644 --- a/Tactility/Source/Tactility.cpp +++ b/Tactility/Source/Tactility.cpp @@ -1,14 +1,15 @@ -#include "Tactility/app/AppManifestParsing.h" - #include #include + +#include #include #include -#include #include +#include #include #include #include +#include #include #include #include @@ -17,7 +18,6 @@ #include #include -#include #ifdef ESP_PLATFORM #include @@ -97,7 +97,7 @@ namespace app { // endregion // List of all apps excluding Boot app (as Boot app calls this function indirectly) -static void registerSystemApps() { +static void registerInternalApps() { addApp(app::alertdialog::manifest); addApp(app::applist::manifest); addApp(app::display::manifest); @@ -199,14 +199,6 @@ static void registerInstalledAppsFromSdCards() { } } -static void registerUserApps(const std::vector& apps) { - TT_LOG_I(TAG, "Registering user apps"); - for (auto* manifest : apps) { - assert(manifest != nullptr); - addApp(*manifest); - } -} - static void registerAndStartSecondaryServices() { TT_LOG_I(TAG, "Registering and starting system services"); addService(service::loader::manifest); @@ -228,28 +220,13 @@ static void registerAndStartPrimaryServices() { #endif } -static void registerAndStartUserServices(const std::vector& manifests) { - TT_LOG_I(TAG, "Registering and starting user services"); - for (auto* manifest : manifests) { - assert(manifest != nullptr); - addService(*manifest); - } -} - void initFromBootApp() { - auto configuration = getConfiguration(); - // Then we register apps. They are not used/started yet. - registerSystemApps(); + registerInternalApps(); auto data_apps_path = std::format("{}/apps", file::MOUNT_POINT_DATA); if (file::isDirectory(data_apps_path)) { registerInstalledApps(data_apps_path); } registerInstalledAppsFromSdCards(); - // Then we register and start user services. They are started after system app - // registration just in case they want to figure out which system apps are installed. - registerAndStartUserServices(configuration->services); - // Now we register the user apps, as they might rely on the user services. - registerUserApps(configuration->apps); } void run(const Configuration& config) {