Merge develop into main (#361)

This commit is contained in:
Ken Van Hoeylandt 2025-10-05 19:37:59 +02:00 committed by GitHub
parent 5777a1381b
commit 2cb413c3d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 16 additions and 69 deletions

View File

@ -1,23 +0,0 @@
#include <Tactility/app/AppManifest.h>
#include <Tactility/lvgl/Toolbar.h>
#include <lvgl.h>
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<HelloWorldApp>
};

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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<const app::AppManifest*> apps = {};
/** List of user services */
const std::vector<const service::ServiceManifest*> services = {};
};
/**

View File

@ -1,14 +1,15 @@
#include "Tactility/app/AppManifestParsing.h"
#include <Tactility/Tactility.h>
#include <Tactility/TactilityConfig.h>
#include <Tactility/app/AppManifestParsing.h>
#include <Tactility/app/AppRegistration.h>
#include <Tactility/DispatcherThread.h>
#include <Tactility/MountPoints.h>
#include <Tactility/file/File.h>
#include <Tactility/file/FileLock.h>
#include <Tactility/file/PropertiesFile.h>
#include <Tactility/hal/HalPrivate.h>
#include <Tactility/lvgl/LvglPrivate.h>
#include <Tactility/MountPoints.h>
#include <Tactility/network/NtpPrivate.h>
#include <Tactility/service/ServiceManifest.h>
#include <Tactility/service/ServiceRegistration.h>
@ -17,7 +18,6 @@
#include <map>
#include <format>
#include <Tactility/file/FileLock.h>
#ifdef ESP_PLATFORM
#include <Tactility/InitEsp.h>
@ -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<const app::AppManifest*>& 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<const service::ServiceManifest*>& 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) {