diff --git a/README.md b/README.md index 86c35848..982707a0 100644 --- a/README.md +++ b/README.md @@ -56,10 +56,17 @@ The build scripts will detect if ESP-IDF is available. They will adapter if you ### Development +Directories explained: + +- `app-esp`: The ESP32 application example +- `app-sim`: The PC/simulator application example +- `boards`: Contains ESP modules with drivers +- `tactility`: The main application platform code ([src/](./tactility/src)) +- `tactility-esp`: ESP-specific application code (e.g. wifi app and service) +- `tactility-core`: Core functionality regarding threads, stdlib, etc. ([src/](./tactility-core/src)) +- `libs`: Contains a mix of regular libraries and ESP modules + Until there is proper documentation, here are some pointers: -- Sample application: [bootstrap](app-esp/src/main.c) and [app](app-esp/src/hello_world/hello_world.c) -- [Tactility](./components/tactility): The main platform with default services and apps. -- [Tactility Core](./tactility-core): The core platform code. ## License diff --git a/app-esp/src/hello_world/hello_world.c b/app-esp/src/hello_world/hello_world.c index 38e713ed..bb101e77 100644 --- a/app-esp/src/hello_world/hello_world.c +++ b/app-esp/src/hello_world/hello_world.c @@ -2,9 +2,7 @@ #include "services/gui/gui.h" #include "services/loader/loader.h" -static void app_show(App app, lv_obj_t* parent) { - UNUSED(app); - +static void app_show(TT_UNUSED App app, lv_obj_t* parent) { lv_obj_t* label = lv_label_create(parent); lv_label_set_recolor(label, true); lv_obj_set_width(label, 200); diff --git a/app-esp/src/main.c b/app-esp/src/main.c index 5cd7b613..31c8d48a 100644 --- a/app-esp/src/main.c +++ b/app-esp/src/main.c @@ -11,7 +11,7 @@ extern const ServiceManifest wifi_service; extern const AppManifest wifi_connect_app; extern const AppManifest wifi_manage_app; -__attribute__((unused)) void app_main(void) { +TT_UNUSED void app_main(void) { static const Config config = { /** * Auto-select a board based on the ./sdkconfig.board.* file @@ -29,7 +29,6 @@ __attribute__((unused)) void app_main(void) { .auto_start_app_id = NULL }; - tt_core_init(); tt_esp_init(&config); tt_init(&config.apps, CONFIG_APPS_LIMIT, &config.services, CONFIG_SERVICES_LIMIT); diff --git a/app-sim/CMakeLists.txt b/app-sim/CMakeLists.txt index ec047d95..90036fb9 100644 --- a/app-sim/CMakeLists.txt +++ b/app-sim/CMakeLists.txt @@ -5,3 +5,6 @@ add_executable(app-sim ${SOURCES}) target_link_libraries(app-sim PRIVATE tactility) target_link_libraries(app-sim PRIVATE tactility-core) +add_definitions(-D_Nullable=) +add_definitions(-D_Nonnull=) + diff --git a/app-sim/src/main.c b/app-sim/src/main.c index 97d95262..6b69ff2b 100644 --- a/app-sim/src/main.c +++ b/app-sim/src/main.c @@ -1,26 +1,17 @@ -#include "log.h" - #include "FreeRTOS.h" -#include "task.h" +#include "log.h" #include "portmacro.h" +#include "tactility.h" +#include "task.h" - -void vAssertCalled( unsigned long ulLine, const char * const pcFileName ) -{ +void vAssertCalled(TT_UNUSED unsigned long line, TT_UNUSED const char* const file) { static portBASE_TYPE xPrinted = pdFALSE; - volatile uint32_t ulSetToNonZeroInDebuggerToContinue = 0; - - /* Parameters are not used. */ - ( void ) ulLine; - ( void ) pcFileName; + volatile uint32_t set_to_nonzero_in_debugger_to_continue = 0; taskENTER_CRITICAL(); { - /* You can step out of this function to debug the assertion by using - the debugger to set ulSetToNonZeroInDebuggerToContinue to a non-zero - value. */ - while( ulSetToNonZeroInDebuggerToContinue == 0 ) - { + // Step out by attaching a debugger and setting set_to_nonzero_in_debugger_to_continue + while (set_to_nonzero_in_debugger_to_continue == 0) { /* NO-OP */ } } taskEXIT_CRITICAL(); diff --git a/tactility-core/src/api_lock.h b/tactility-core/src/api_lock.h index e47f65b0..abb53d54 100644 --- a/tactility-core/src/api_lock.h +++ b/tactility-core/src/api_lock.h @@ -1,6 +1,6 @@ #pragma once -#include "core.h" +#include "event_flag.h" typedef EventFlag* ApiLock; diff --git a/tactility-core/src/core.c b/tactility-core/src/core.c deleted file mode 100644 index a3283382..00000000 --- a/tactility-core/src/core.c +++ /dev/null @@ -1,14 +0,0 @@ -#include "core.h" - -#include "app_manifest_registry.h" -#include "service_registry.h" - -#define TAG "tactility" - -void tt_core_init() { - TT_LOG_I(TAG, "core init start"); - tt_assert(!tt_kernel_is_irq()); - tt_service_registry_init(); - tt_app_manifest_registry_init(); - TT_LOG_I(TAG, "core init complete"); -} diff --git a/tactility-core/src/core.h b/tactility-core/src/core.h deleted file mode 100644 index e69821f2..00000000 --- a/tactility-core/src/core.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include - -#include "tactility_core.h" - -#include "event_flag.h" -#include "kernel.h" -#include "message_queue.h" -#include "mutex.h" -#include "pubsub.h" -#include "semaphore.h" -#include "string.h" -#include "thread.h" -#include "timer.h" -#include "tt_stream_buffer.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void tt_core_init(); - -#ifdef __cplusplus -} -#endif diff --git a/tactility-core/src/core_defines.h b/tactility-core/src/core_defines.h index c591357c..26725ee2 100644 --- a/tactility-core/src/core_defines.h +++ b/tactility-core/src/core_defines.h @@ -8,18 +8,20 @@ #include "portmacro.h" #endif -#ifdef __cplusplus -extern "C" { -#endif - #define TT_RETURNS_NONNULL __attribute__((returns_nonnull)) #define TT_WARN_UNUSED __attribute__((warn_unused_result)) +#define TT_UNUSED __attribute__((unused)) + #define TT_WEAK __attribute__((weak)) #define TT_PACKED __attribute__((packed)) +#define TT_PLACE_IN_SECTION(x) __attribute__((section(x))) + +#define TT_ALIGN(n) __attribute__((aligned(n))) + // Used by portENABLE_INTERRUPTS and portDISABLE_INTERRUPTS? #ifdef ESP_TARGET #define TT_IS_IRQ_MODE() (xPortInIsrContext() == pdTRUE) @@ -30,7 +32,3 @@ extern "C" { #define TT_IS_ISR() (TT_IS_IRQ_MODE()) #define TT_CHECK_RETURN __attribute__((__warn_unused_result__)) - -#ifdef __cplusplus -} -#endif diff --git a/tactility-core/src/core_extra_defines.h b/tactility-core/src/core_extra_defines.h index 9a231694..2132b4e4 100644 --- a/tactility-core/src/core_extra_defines.h +++ b/tactility-core/src/core_extra_defines.h @@ -1,114 +1,62 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef MAX -#define MAX(a, b) \ +#define TT_MAX(a, b) \ ({ \ __typeof__(a) _a = (a); \ __typeof__(b) _b = (b); \ _a > _b ? _a : _b; \ }) -#endif -#ifndef MIN -#define MIN(a, b) \ +#define TT_MIN(a, b) \ ({ \ __typeof__(a) _a = (a); \ __typeof__(b) _b = (b); \ _a < _b ? _a : _b; \ }) -#endif -#ifndef ABS -#define ABS(a) ({ (a) < 0 ? -(a) : (a); }) -#endif +#define TT_ABS(a) ({ (a) < 0 ? -(a) : (a); }) -#ifndef ROUND_UP_TO -#define ROUND_UP_TO(a, b) \ +#define TT_ROUND_UP_TO(a, b) \ ({ \ __typeof__(a) _a = (a); \ __typeof__(b) _b = (b); \ _a / _b + !!(_a % _b); \ }) -#endif -#ifndef CLAMP -#define CLAMP(x, upper, lower) (MIN(upper, MAX(x, lower))) -#endif +#define TT_CLAMP(x, upper, lower) (TT_MIN(upper, TT_MAX(x, lower))) -#ifndef COUNT_OF -#define COUNT_OF(x) (sizeof(x) / sizeof(x[0])) -#endif +#define TT_COUNT_OF(x) (sizeof(x) / sizeof(x[0])) -#ifndef TT_SWAP -#define TT_SWAP(x, y) \ +#define TT_SWAP(x, y) \ do { \ typeof(x) SWAP = x; \ x = y; \ y = SWAP; \ } while (0) -#endif -#ifndef PLACE_IN_SECTION -#define PLACE_IN_SECTION(x) __attribute__((section(x))) -#endif +#define TT_STRINGIFY(x) #x -#ifndef ALIGN -#define ALIGN(n) __attribute__((aligned(n))) -#endif +#define TT_TOSTRING(x) TT_STRINGIFY(x) -#ifndef __weak -#define __weak __attribute__((weak)) -#endif +#define TT_CONCATENATE(a, b) CONCATENATE_(a, b) +#define TT_CONCATENATE_(a, b) a##b -#ifndef UNUSED -#define UNUSED(X) (void)(X) -#endif - -#ifndef STRINGIFY -#define STRINGIFY(x) #x -#endif - -#ifndef TOSTRING -#define TOSTRING(x) STRINGIFY(x) -#endif - -#ifndef CONCATENATE -#define CONCATENATE(a, b) CONCATENATE_(a, b) -#define CONCATENATE_(a, b) a##b -#endif - -#ifndef REVERSE_BYTES_U32 -#define REVERSE_BYTES_U32(x) \ +#define TT_REVERSE_BYTES_U32(x) \ ((((x) & 0x000000FF) << 24) | (((x) & 0x0000FF00) << 8) | (((x) & 0x00FF0000) >> 8) | \ (((x) & 0xFF000000) >> 24)) -#endif -#ifndef TT_BIT #define TT_BIT(x, n) (((x) >> (n)) & 1) -#endif -#ifndef TT_BIT_SET -#define TT_BIT_SET(x, n) \ +#define TT_BIT_SET(x, n) \ ({ \ __typeof__(x) _x = (1); \ (x) |= (_x << (n)); \ }) -#endif -#ifndef TT_BIT_CLEAR -#define TT_BIT_CLEAR(x, n) \ +#define TT_BIT_CLEAR(x, n) \ ({ \ __typeof__(x) _x = (1); \ (x) &= ~(_x << (n)); \ }) -#endif #define TT_SW_MEMBARRIER() asm volatile("" : : : "memory") - -#ifdef __cplusplus -} -#endif diff --git a/tactility-core/src/m_cstr_dup.h b/tactility-core/src/m_cstr_dup.h index 92908fef..3d257f8a 100644 --- a/tactility-core/src/m_cstr_dup.h +++ b/tactility-core/src/m_cstr_dup.h @@ -1,3 +1,6 @@ +/** @file:m_cstr_dup.h + * @brief Helpers for mlib + */ #pragma once #include diff --git a/tactility-core/src/tactility_core.h b/tactility-core/src/tactility_core.h index 3886d77c..91aa4988 100644 --- a/tactility-core/src/tactility_core.h +++ b/tactility-core/src/tactility_core.h @@ -3,13 +3,10 @@ #include #include -#include "app.h" #include "check.h" -#include "core.h" #include "core_defines.h" #include "core_extra_defines.h" #include "core_types.h" #include "critical.h" #include "event_flag.h" #include "log.h" -#include "service.h" diff --git a/tactility-esp/src/apps/system/wifi_connect/wifi_connect.c b/tactility-esp/src/apps/system/wifi_connect/wifi_connect.c index 647d515a..184a0039 100644 --- a/tactility-esp/src/apps/system/wifi_connect/wifi_connect.c +++ b/tactility-esp/src/apps/system/wifi_connect/wifi_connect.c @@ -12,8 +12,7 @@ // Forward declarations static void wifi_connect_event_callback(const void* message, void* context); -static void on_connect(const char* ssid, const char* password, void* parameter) { - UNUSED(parameter); +static void on_connect(const char* ssid, const char* password, TT_UNUSED void* parameter) { wifi_connect(ssid, password); } diff --git a/tactility-esp/src/apps/system/wifi_connect/wifi_connect_view.c b/tactility-esp/src/apps/system/wifi_connect/wifi_connect_view.c index baceae71..c574404c 100644 --- a/tactility-esp/src/apps/system/wifi_connect/wifi_connect_view.c +++ b/tactility-esp/src/apps/system/wifi_connect/wifi_connect_view.c @@ -17,8 +17,7 @@ static void show_keyboard(lv_event_t* event) { lv_obj_scroll_to_view(event->current_target, LV_ANIM_ON); } -static void hide_keyboard(lv_event_t* event) { - UNUSED(event); +static void hide_keyboard(TT_UNUSED lv_event_t* event) { gui_keyboard_hide(); } @@ -126,11 +125,14 @@ void wifi_connect_view_create(App app, void* wifi, lv_obj_t* parent) { } } -void wifi_connect_view_destroy(WifiConnectView* view) { +void wifi_connect_view_destroy(TT_UNUSED WifiConnectView* view) { + // NO-OP } -void wifi_connect_view_update(WifiConnectView* view, WifiConnectBindings* bindings, WifiConnectState* state) { - UNUSED(view); - UNUSED(bindings); - UNUSED(state); +void wifi_connect_view_update( + TT_UNUSED WifiConnectView* view, + TT_UNUSED WifiConnectBindings* bindings, + TT_UNUSED WifiConnectState* state +) { + // NO-OP } diff --git a/tactility-esp/src/services/wifi/wifi.c b/tactility-esp/src/services/wifi/wifi.c index 52779dc2..c3ffef31 100644 --- a/tactility-esp/src/services/wifi/wifi.c +++ b/tactility-esp/src/services/wifi/wifi.c @@ -155,7 +155,7 @@ void wifi_get_scan_results(WifiApRecord records[], uint16_t limit, uint16_t* res } else { uint16_t i = 0; TT_LOG_I(TAG, "processing up to %d APs", wifi_singleton->scan_list_count); - uint16_t last_index = MIN(wifi_singleton->scan_list_count, limit); + uint16_t last_index = TT_MIN(wifi_singleton->scan_list_count, limit); for (; i < last_index; ++i) { memcpy(records[i].ssid, wifi_singleton->scan_list[i].ssid, 33); records[i].rssi = wifi_singleton->scan_list[i].rssi; @@ -224,8 +224,7 @@ static void wifi_publish_event_simple(Wifi* wifi, WifiEventType type) { tt_pubsub_publish(wifi->pubsub, &turning_on_event); } -static void event_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data) { - UNUSED(arg); +static void event_handler(TT_UNUSED void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data) { if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) { TT_LOG_I(TAG, "event_handler: sta start"); if (wifi_singleton->radio_state == WIFI_RADIO_CONNECTION_PENDING) { @@ -397,7 +396,7 @@ static void wifi_scan_internal(Wifi* wifi) { esp_wifi_scan_start(NULL, true); uint16_t record_count = wifi->scan_list_limit; ESP_ERROR_CHECK(esp_wifi_scan_get_ap_records(&record_count, wifi->scan_list)); - uint16_t safe_record_count = MIN(wifi->scan_list_limit, record_count); + uint16_t safe_record_count = TT_MIN(wifi->scan_list_limit, record_count); wifi->scan_list_count = safe_record_count; TT_LOG_I(TAG, "Scanned %u APs. Showing %u:", record_count, safe_record_count); for (uint16_t i = 0; i < safe_record_count; i++) { @@ -529,9 +528,7 @@ static void wifi_disconnect_internal_but_keep_active(Wifi* wifi) { } // ESP wifi APIs need to run from the main task, so we can't just spawn a thread -_Noreturn int32_t wifi_main(void* p) { - UNUSED(p); - +_Noreturn int32_t wifi_main(TT_UNUSED void* parameter) { TT_LOG_I(TAG, "Started main loop"); tt_check(wifi_singleton != NULL); Wifi* wifi = wifi_singleton; @@ -562,14 +559,12 @@ _Noreturn int32_t wifi_main(void* p) { } } -static void wifi_service_start(Service service) { - UNUSED(service); +static void wifi_service_start(TT_UNUSED Service service) { tt_check(wifi_singleton == NULL); wifi_singleton = wifi_alloc(); } -static void wifi_service_stop(Service service) { - UNUSED(service); +static void wifi_service_stop(TT_UNUSED Service service) { tt_check(wifi_singleton != NULL); WifiRadioState state = wifi_singleton->radio_state; diff --git a/tactility-esp/src/tactility-esp.c b/tactility-esp/src/tactility-esp.c index fa477793..0ddc5292 100644 --- a/tactility-esp/src/tactility-esp.c +++ b/tactility-esp/src/tactility-esp.c @@ -1,6 +1,5 @@ #include "tactility.h" -#include "core.h" #include "graphics_i.h" #include "devices_i.h" // TODO: Rename to hardware*.* #include "nvs_flash.h" diff --git a/tactility-core/src/app.c b/tactility/src/app.c similarity index 100% rename from tactility-core/src/app.c rename to tactility/src/app.c diff --git a/tactility-core/src/app.h b/tactility/src/app.h similarity index 100% rename from tactility-core/src/app.h rename to tactility/src/app.h diff --git a/tactility-core/src/app_i.h b/tactility/src/app_i.h similarity index 100% rename from tactility-core/src/app_i.h rename to tactility/src/app_i.h diff --git a/tactility-core/src/app_manifest.h b/tactility/src/app_manifest.h similarity index 96% rename from tactility-core/src/app_manifest.h rename to tactility/src/app_manifest.h index a7d80999..ea3b7443 100644 --- a/tactility-core/src/app_manifest.h +++ b/tactility/src/app_manifest.h @@ -1,7 +1,6 @@ #pragma once -#include -#include +#include "core_defines.h" #ifdef __cplusplus extern "C" { diff --git a/tactility-core/src/app_manifest_registry.c b/tactility/src/app_manifest_registry.c similarity index 100% rename from tactility-core/src/app_manifest_registry.c rename to tactility/src/app_manifest_registry.c diff --git a/tactility-core/src/app_manifest_registry.h b/tactility/src/app_manifest_registry.h similarity index 100% rename from tactility-core/src/app_manifest_registry.h rename to tactility/src/app_manifest_registry.h diff --git a/tactility/src/apps/desktop/desktop.c b/tactility/src/apps/desktop/desktop.c index 2a077d73..b9e552eb 100644 --- a/tactility/src/apps/desktop/desktop.c +++ b/tactility/src/apps/desktop/desktop.c @@ -18,9 +18,7 @@ static void create_app_widget(const AppManifest* manifest, void* _Nullable paren lv_obj_add_event_cb(btn, &on_app_pressed, LV_EVENT_CLICKED, (void*)manifest); } -static void desktop_show(App app, lv_obj_t* parent) { - UNUSED(app); - +static void desktop_show(TT_UNUSED App app, TT_UNUSED lv_obj_t* parent) { lv_obj_t* list = lv_list_create(parent); lv_obj_set_size(list, LV_PCT(100), LV_PCT(100)); lv_obj_center(list); diff --git a/tactility/src/apps/system/system_info/system_info.c b/tactility/src/apps/system/system_info/system_info.c index 844d9fca..f956320d 100644 --- a/tactility/src/apps/system/system_info/system_info.c +++ b/tactility/src/apps/system/system_info/system_info.c @@ -3,9 +3,7 @@ #include "lvgl.h" #include "thread.h" -static void app_show(App app, lv_obj_t* parent) { - UNUSED(app); - +static void app_show(TT_UNUSED App app, lv_obj_t* parent) { lv_obj_t* heap_info = lv_label_create(parent); lv_label_set_recolor(heap_info, true); lv_obj_set_width(heap_info, 200); diff --git a/tactility-core/src/service.c b/tactility/src/service.c similarity index 100% rename from tactility-core/src/service.c rename to tactility/src/service.c diff --git a/tactility-core/src/service.h b/tactility/src/service.h similarity index 100% rename from tactility-core/src/service.h rename to tactility/src/service.h diff --git a/tactility-core/src/service_i.h b/tactility/src/service_i.h similarity index 100% rename from tactility-core/src/service_i.h rename to tactility/src/service_i.h diff --git a/tactility-core/src/service_manifest.h b/tactility/src/service_manifest.h similarity index 92% rename from tactility-core/src/service_manifest.h rename to tactility/src/service_manifest.h index 7c656cec..62e4fe41 100644 --- a/tactility-core/src/service_manifest.h +++ b/tactility/src/service_manifest.h @@ -1,6 +1,6 @@ #pragma once -#include +#include "tactility_core.h" #ifdef __cplusplus extern "C" { @@ -15,7 +15,7 @@ typedef struct { /** * The identifier by which the app is launched by the system and other apps. */ - const char* _Nonnull id; + const char* id; /** * Non-blocking method to call when service is started. diff --git a/tactility-core/src/service_registry.c b/tactility/src/service_registry.c similarity index 99% rename from tactility-core/src/service_registry.c rename to tactility/src/service_registry.c index e5e5f0b8..b211dc3e 100644 --- a/tactility-core/src/service_registry.c +++ b/tactility/src/service_registry.c @@ -4,6 +4,7 @@ #include "m_cstr_dup.h" #include "mutex.h" #include "service_i.h" +#include "service_manifest.h" #include "tactility_core.h" #define TAG "service_registry" diff --git a/tactility-core/src/service_registry.h b/tactility/src/service_registry.h similarity index 96% rename from tactility-core/src/service_registry.h rename to tactility/src/service_registry.h index 6defbac0..7942e242 100644 --- a/tactility-core/src/service_registry.h +++ b/tactility/src/service_registry.h @@ -1,6 +1,7 @@ #pragma once #include "service_manifest.h" +#include "tactility_core.h" #ifdef __cplusplus extern "C" { diff --git a/tactility/src/services/gui/gui.c b/tactility/src/services/gui/gui.c index 6c6164fe..35b90b27 100644 --- a/tactility/src/services/gui/gui.c +++ b/tactility/src/services/gui/gui.c @@ -118,8 +118,7 @@ void gui_hide_app() { gui_unlock(); } -static int32_t gui_main(void* p) { - UNUSED(p); +static int32_t gui_main(TT_UNUSED void* p) { tt_check(gui); Gui* local_gui = gui; @@ -146,18 +145,14 @@ static int32_t gui_main(void* p) { // region AppManifest -static void gui_start(Service service) { - UNUSED(service); - +static void gui_start(TT_UNUSED Service service) { gui = gui_alloc(); tt_thread_set_priority(gui->thread, ThreadPriorityNormal); tt_thread_start(gui->thread); } -static void gui_stop(Service service) { - UNUSED(service); - +static void gui_stop(TT_UNUSED Service service) { gui_lock(); ThreadId thread_id = tt_thread_get_id(gui->thread); diff --git a/tactility/src/services/loader/loader.c b/tactility/src/services/loader/loader.c index fe7cfd4e..e5ee881c 100644 --- a/tactility/src/services/loader/loader.c +++ b/tactility/src/services/loader/loader.c @@ -263,9 +263,7 @@ static void loader_do_stop_app() { } -static int32_t loader_main(void* p) { - UNUSED(p); - +static int32_t loader_main(TT_UNUSED void* parameter) { LoaderMessage message; bool exit_requested = false; while (!exit_requested) { @@ -298,8 +296,7 @@ static int32_t loader_main(void* p) { // region AppManifest -static void loader_start(Service service) { - UNUSED(service); +static void loader_start(TT_UNUSED Service service) { tt_check(loader_singleton == NULL); loader_singleton = loader_alloc(); @@ -307,8 +304,7 @@ static void loader_start(Service service) { tt_thread_start(loader_singleton->thread); } -static void loader_stop(Service service) { - UNUSED(service); +static void loader_stop(TT_UNUSED Service service) { tt_check(loader_singleton != NULL); // Send stop signal to thread and wait for thread to finish diff --git a/tactility/src/tactility.c b/tactility/src/tactility.c index 9a95d296..e0ef4d17 100644 --- a/tactility/src/tactility.c +++ b/tactility/src/tactility.c @@ -1,7 +1,6 @@ #include "tactility.h" #include "app_manifest_registry.h" -#include "core.h" #include "service_registry.h" #define TAG "tactility" @@ -65,12 +64,15 @@ static void register_and_start_user_services( } } -__attribute__((unused)) void tt_init( +TT_UNUSED void tt_init( const AppManifest* const* _Nonnull apps, size_t apps_count, const ServiceManifest* const* services, size_t services_count ) { + tt_service_registry_init(); + tt_app_manifest_registry_init(); + TT_LOG_I(TAG, "tt_init started"); // Register all apps register_system_services(); @@ -83,4 +85,3 @@ __attribute__((unused)) void tt_init( register_and_start_user_services(services, services_count); TT_LOG_I(TAG, "tt_init complete"); } - diff --git a/tactility/src/tactility.h b/tactility/src/tactility.h index db076f4d..c38b1c93 100644 --- a/tactility/src/tactility.h +++ b/tactility/src/tactility.h @@ -1,13 +1,14 @@ #pragma once -#include "tactility_core.h" +#include "app_manifest.h" +#include "service_manifest.h" #ifdef __cplusplus extern "C" { #endif -__attribute__((unused)) void tt_init( - const AppManifest* const* _Nonnull apps, +TT_UNUSED void tt_init( + const AppManifest* const* apps, size_t apps_count, const ServiceManifest* const* services, size_t services_count