mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-19 23:15:05 +00:00
Merge develop into main (#361)
This commit is contained in:
parent
5777a1381b
commit
2cb413c3d1
@ -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>
|
|
||||||
};
|
|
||||||
@ -24,9 +24,9 @@ function(INIT_TACTILITY_GLOBALS SDKCONFIG_FILE)
|
|||||||
if (board_id STREQUAL "cyd-2432s024c")
|
if (board_id STREQUAL "cyd-2432s024c")
|
||||||
set(TACTILITY_BOARD_PROJECT CYD-2432S024C)
|
set(TACTILITY_BOARD_PROJECT CYD-2432S024C)
|
||||||
elseif (board_id STREQUAL "cyd-2432s028r")
|
elseif (board_id STREQUAL "cyd-2432s028r")
|
||||||
set(TACTILITY_BOARD_PROJECT CYD-2432S028R)
|
set(TACTILITY_BOARD_PROJECT CYD-2432S028R)
|
||||||
elseif (board_id STREQUAL "cyd-e32r28t")
|
elseif (board_id STREQUAL "cyd-e32r28t")
|
||||||
set(TACTILITY_BOARD_PROJECT CYD-E32R28T)
|
set(TACTILITY_BOARD_PROJECT CYD-E32R28T)
|
||||||
elseif (board_id STREQUAL "cyd-2432s032c")
|
elseif (board_id STREQUAL "cyd-2432s032c")
|
||||||
set(TACTILITY_BOARD_PROJECT CYD-2432S032C)
|
set(TACTILITY_BOARD_PROJECT CYD-2432S032C)
|
||||||
elseif (board_id STREQUAL "cyd-4848s040c")
|
elseif (board_id STREQUAL "cyd-4848s040c")
|
||||||
|
|||||||
@ -29,9 +29,9 @@ if (DEFINED ENV{ESP_IDF_VERSION})
|
|||||||
init_tactility_globals("sdkconfig")
|
init_tactility_globals("sdkconfig")
|
||||||
get_property(TACTILITY_BOARD_PROJECT GLOBAL PROPERTY TACTILITY_BOARD_PROJECT)
|
get_property(TACTILITY_BOARD_PROJECT GLOBAL PROPERTY TACTILITY_BOARD_PROJECT)
|
||||||
|
|
||||||
set(COMPONENTS App)
|
set(COMPONENTS Firmware)
|
||||||
set(EXTRA_COMPONENT_DIRS
|
set(EXTRA_COMPONENT_DIRS
|
||||||
"App"
|
"Firmware"
|
||||||
"Boards/${TACTILITY_BOARD_PROJECT}"
|
"Boards/${TACTILITY_BOARD_PROJECT}"
|
||||||
"Drivers"
|
"Drivers"
|
||||||
"Tactility"
|
"Tactility"
|
||||||
@ -93,7 +93,7 @@ if (NOT DEFINED ENV{ESP_IDF_VERSION})
|
|||||||
add_subdirectory(Libraries/mbedtls)
|
add_subdirectory(Libraries/mbedtls)
|
||||||
|
|
||||||
# Sim app
|
# Sim app
|
||||||
add_subdirectory(App)
|
add_subdirectory(Firmware)
|
||||||
|
|
||||||
# Tests
|
# Tests
|
||||||
add_subdirectory(Tests)
|
add_subdirectory(Tests)
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
cmake_minimum_required(VERSION 3.20)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
|
file(GLOB_RECURSE SOURCE_FILES "Source/*.c*")
|
||||||
|
|
||||||
if (DEFINED ENV{ESP_IDF_VERSION})
|
if (DEFINED ENV{ESP_IDF_VERSION})
|
||||||
# Read board id/project
|
# Read board id/project
|
||||||
include("../Buildscripts/board.cmake")
|
include("../Buildscripts/board.cmake")
|
||||||
@ -7,15 +9,13 @@ if (DEFINED ENV{ESP_IDF_VERSION})
|
|||||||
get_property(TACTILITY_BOARD_PROJECT GLOBAL PROPERTY TACTILITY_BOARD_PROJECT)
|
get_property(TACTILITY_BOARD_PROJECT GLOBAL PROPERTY TACTILITY_BOARD_PROJECT)
|
||||||
|
|
||||||
idf_component_register(
|
idf_component_register(
|
||||||
SRC_DIRS "Source"
|
SRCS ${SOURCE_FILES}
|
||||||
"Source/HelloWorld"
|
|
||||||
REQUIRES ${BOARD_COMPONENTS}
|
REQUIRES ${BOARD_COMPONENTS}
|
||||||
REQUIRES Tactility TactilityC ${TACTILITY_BOARD_PROJECT}
|
REQUIRES Tactility TactilityC ${TACTILITY_BOARD_PROJECT}
|
||||||
)
|
)
|
||||||
else ()
|
else ()
|
||||||
|
|
||||||
file(GLOB_RECURSE SOURCES "Source/*.c*")
|
add_executable(AppSim ${SOURCE_FILES})
|
||||||
add_executable(AppSim ${SOURCES})
|
|
||||||
target_link_libraries(AppSim
|
target_link_libraries(AppSim
|
||||||
PRIVATE Tactility
|
PRIVATE Tactility
|
||||||
PRIVATE TactilityCore
|
PRIVATE TactilityCore
|
||||||
@ -15,10 +15,7 @@ void app_main() {
|
|||||||
* Auto-select a board based on the ./sdkconfig.board.* file
|
* Auto-select a board based on the ./sdkconfig.board.* file
|
||||||
* that you copied to ./sdkconfig before you opened this project.
|
* that you copied to ./sdkconfig before you opened this project.
|
||||||
*/
|
*/
|
||||||
.hardware = TT_BOARD_HARDWARE,
|
.hardware = TT_BOARD_HARDWARE
|
||||||
.apps = {
|
|
||||||
// &hello_world_app,
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef ESP_PLATFORM
|
#ifdef ESP_PLATFORM
|
||||||
@ -15,10 +15,6 @@ namespace app::launcher { extern const AppManifest manifest; }
|
|||||||
struct Configuration {
|
struct Configuration {
|
||||||
/** HAL configuration (drivers) */
|
/** HAL configuration (drivers) */
|
||||||
const hal::Configuration* hardware = nullptr;
|
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 = {};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,14 +1,15 @@
|
|||||||
#include "Tactility/app/AppManifestParsing.h"
|
|
||||||
|
|
||||||
#include <Tactility/Tactility.h>
|
#include <Tactility/Tactility.h>
|
||||||
#include <Tactility/TactilityConfig.h>
|
#include <Tactility/TactilityConfig.h>
|
||||||
|
|
||||||
|
#include <Tactility/app/AppManifestParsing.h>
|
||||||
#include <Tactility/app/AppRegistration.h>
|
#include <Tactility/app/AppRegistration.h>
|
||||||
#include <Tactility/DispatcherThread.h>
|
#include <Tactility/DispatcherThread.h>
|
||||||
#include <Tactility/MountPoints.h>
|
|
||||||
#include <Tactility/file/File.h>
|
#include <Tactility/file/File.h>
|
||||||
|
#include <Tactility/file/FileLock.h>
|
||||||
#include <Tactility/file/PropertiesFile.h>
|
#include <Tactility/file/PropertiesFile.h>
|
||||||
#include <Tactility/hal/HalPrivate.h>
|
#include <Tactility/hal/HalPrivate.h>
|
||||||
#include <Tactility/lvgl/LvglPrivate.h>
|
#include <Tactility/lvgl/LvglPrivate.h>
|
||||||
|
#include <Tactility/MountPoints.h>
|
||||||
#include <Tactility/network/NtpPrivate.h>
|
#include <Tactility/network/NtpPrivate.h>
|
||||||
#include <Tactility/service/ServiceManifest.h>
|
#include <Tactility/service/ServiceManifest.h>
|
||||||
#include <Tactility/service/ServiceRegistration.h>
|
#include <Tactility/service/ServiceRegistration.h>
|
||||||
@ -17,7 +18,6 @@
|
|||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <format>
|
#include <format>
|
||||||
#include <Tactility/file/FileLock.h>
|
|
||||||
|
|
||||||
#ifdef ESP_PLATFORM
|
#ifdef ESP_PLATFORM
|
||||||
#include <Tactility/InitEsp.h>
|
#include <Tactility/InitEsp.h>
|
||||||
@ -97,7 +97,7 @@ namespace app {
|
|||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// List of all apps excluding Boot app (as Boot app calls this function indirectly)
|
// 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::alertdialog::manifest);
|
||||||
addApp(app::applist::manifest);
|
addApp(app::applist::manifest);
|
||||||
addApp(app::display::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() {
|
static void registerAndStartSecondaryServices() {
|
||||||
TT_LOG_I(TAG, "Registering and starting system services");
|
TT_LOG_I(TAG, "Registering and starting system services");
|
||||||
addService(service::loader::manifest);
|
addService(service::loader::manifest);
|
||||||
@ -228,28 +220,13 @@ static void registerAndStartPrimaryServices() {
|
|||||||
#endif
|
#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() {
|
void initFromBootApp() {
|
||||||
auto configuration = getConfiguration();
|
registerInternalApps();
|
||||||
// Then we register apps. They are not used/started yet.
|
|
||||||
registerSystemApps();
|
|
||||||
auto data_apps_path = std::format("{}/apps", file::MOUNT_POINT_DATA);
|
auto data_apps_path = std::format("{}/apps", file::MOUNT_POINT_DATA);
|
||||||
if (file::isDirectory(data_apps_path)) {
|
if (file::isDirectory(data_apps_path)) {
|
||||||
registerInstalledApps(data_apps_path);
|
registerInstalledApps(data_apps_path);
|
||||||
}
|
}
|
||||||
registerInstalledAppsFromSdCards();
|
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) {
|
void run(const Configuration& config) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user