Rename project to tactility (#7)

* wifi wip

* renamed project to Tactility

* renamed code files and defines

* changed prefixes to tt_

* removed wifi wip code
This commit is contained in:
Ken Van Hoeylandt
2024-01-06 12:24:38 +01:00
committed by GitHub
parent b0ffa04d78
commit 28bd80c1f1
64 changed files with 92 additions and 89 deletions
-13
View File
@@ -1,13 +0,0 @@
#pragma once
#include "nanobake.h"
#ifdef __cplusplus
extern "C" {
#endif
Hardware nb_hardware_init(const HardwareConfig _Nonnull* config);
#ifdef __cplusplus
}
#endif

Before

Width:  |  Height:  |  Size: 274 B

After

Width:  |  Height:  |  Size: 274 B

Before

Width:  |  Height:  |  Size: 224 B

After

Width:  |  Height:  |  Size: 224 B

@@ -5,7 +5,7 @@
#define TAG "hardware"
Hardware nb_hardware_init(const HardwareConfig _Nonnull* config) {
Hardware tt_hardware_init(const HardwareConfig _Nonnull* config) {
if (config->bootstrap != NULL) {
ESP_LOGI(TAG, "Bootstrapping");
config->bootstrap();
@@ -14,13 +14,13 @@ Hardware nb_hardware_init(const HardwareConfig _Nonnull* config) {
furi_check(config->display_driver != NULL, "no display driver configured");
DisplayDriver display_driver = config->display_driver();
ESP_LOGI(TAG, "display with driver %s", display_driver.name);
DisplayDevice* display = nb_display_device_alloc(&display_driver);
DisplayDevice* display = tt_display_device_alloc(&display_driver);
TouchDevice* touch = NULL;
if (config->touch_driver != NULL) {
TouchDriver touch_driver = config->touch_driver();
ESP_LOGI(TAG, "touch with driver %s", touch_driver.name);
touch = nb_touch_alloc(&touch_driver);
touch = tt_touch_alloc(&touch_driver);
} else {
ESP_LOGI(TAG, "no touch configured");
touch = NULL;
+13
View File
@@ -0,0 +1,13 @@
#pragma once
#include "tactility.h"
#ifdef __cplusplus
extern "C" {
#endif
Hardware tt_hardware_init(const HardwareConfig _Nonnull* config);
#ifdef __cplusplus
}
#endif
@@ -1,7 +1,7 @@
#include "check.h"
#include "display.h"
DisplayDevice _Nonnull* nb_display_device_alloc(DisplayDriver _Nonnull* driver) {
DisplayDevice _Nonnull* tt_display_device_alloc(DisplayDriver _Nonnull* driver) {
DisplayDevice _Nonnull* display = malloc(sizeof(DisplayDevice));
memset(display, 0, sizeof(DisplayDevice));
furi_check(driver->create_display_device(display), "failed to create display");
@@ -31,7 +31,7 @@ typedef struct {
* @param[in] driver
* @return allocated display object
*/
DisplayDevice _Nonnull* nb_display_device_alloc(DisplayDriver _Nonnull* driver);
DisplayDevice _Nonnull* tt_display_device_alloc(DisplayDriver _Nonnull* driver);
#ifdef __cplusplus
}
@@ -5,7 +5,7 @@
#define TAG "lvgl"
Lvgl nb_graphics_init(Hardware _Nonnull* hardware) {
Lvgl tt_graphics_init(Hardware _Nonnull* hardware) {
const lvgl_port_cfg_t lvgl_cfg = {
.task_priority = 4,
.task_stack = 4096,
@@ -7,7 +7,7 @@
extern "C" {
#endif
Lvgl nb_graphics_init(Hardware _Nonnull* hardware);
Lvgl tt_graphics_init(Hardware _Nonnull* hardware);
#ifdef __cplusplus
}
@@ -37,7 +37,7 @@ static esp_err_t spiffs_init(esp_vfs_spiffs_conf_t* conf) {
return ESP_OK;
}
esp_err_t nb_partitions_init() {
esp_err_t tt_partitions_init() {
ESP_ERROR_CHECK(nvs_flash_init_safely());
esp_vfs_spiffs_conf_t assets_spiffs = {
@@ -5,4 +5,4 @@
#define MOUNT_POINT_ASSETS "/assets"
#define MOUNT_POINT_CONFIG "/config"
esp_err_t nb_partitions_init();
esp_err_t tt_partitions_init();
@@ -59,7 +59,7 @@ LoaderStatus loader_start_app(const char* id, const char* args, FuriString* erro
LoaderMessage message;
LoaderMessageLoaderStatusResult result;
message.type = LoaderMessageTypeStartByName;
message.type = LoaderMessageTypeAppStart;
message.start.id = id;
message.start.args = args;
message.start.error_message = error_message;
@@ -74,7 +74,7 @@ void loader_start_app_nonblocking(const char* id, const char* args) {
LoaderMessage message;
LoaderMessageLoaderStatusResult result;
message.type = LoaderMessageTypeStartByName;
message.type = LoaderMessageTypeAppStart;
message.start.id = id;
message.start.args = args;
message.start.error_message = NULL;
@@ -173,6 +173,11 @@ static void loader_start_app_with_manifest(
}
loader_unlock();
LoaderEvent event = {
.type = LoaderEventTypeApplicationStarted
};
furi_pubsub_publish(loader->pubsub, &event);
}
static LoaderStatus loader_do_start_by_id(
@@ -234,8 +239,9 @@ static void loader_do_stop_app() {
heap_caps_get_free_size(MALLOC_CAP_INTERNAL)
);
LoaderEvent event;
event.type = LoaderEventTypeApplicationStopped;
LoaderEvent event = {
.type = LoaderEventTypeApplicationStopped
};
furi_pubsub_publish(loader->pubsub, &event);
}
@@ -256,7 +262,7 @@ static int32_t loader_main(void* p) {
if (furi_message_queue_get(loader->queue, &message, FuriWaitForever) == FuriStatusOk) {
FURI_LOG_I(TAG, "Processing message of type %d", message.type);
switch (message.type) {
case LoaderMessageTypeStartByName:
case LoaderMessageTypeAppStart:
if (loader_is_app_running()) {
loader_do_stop_app();
}
@@ -272,7 +278,7 @@ static int32_t loader_main(void* p) {
case LoaderMessageTypeAppStop:
loader_do_stop_app();
break;
case LoaderMessageTypeExit:
case LoaderMessageTypeServiceStop:
exit_requested = true;
break;
}
@@ -297,7 +303,7 @@ static void loader_stop() {
furi_check(loader != NULL);
LoaderMessage message = {
.api_lock = NULL,
.type = LoaderMessageTypeExit
.type = LoaderMessageTypeServiceStop
};
// Send stop signal to thread and wait for thread to finish
@@ -25,16 +25,16 @@ struct Loader {
};
typedef enum {
LoaderMessageTypeStartByName,
LoaderMessageTypeAppStart,
LoaderMessageTypeAppStop,
LoaderMessageTypeExit,
LoaderMessageTypeServiceStop,
} LoaderMessageType;
typedef struct {
const char* id;
const char* args;
FuriString* error_message;
} LoaderMessageStartById;
} LoaderMessageAppStart;
typedef struct {
LoaderStatus value;
@@ -51,7 +51,7 @@ typedef struct {
LoaderMessageType type;
union {
LoaderMessageStartById start;
LoaderMessageAppStart start;
};
union {
@@ -1,12 +1,12 @@
#include "nanobake.h"
#include "app_manifest_registry.h"
#include "devices_i.h"
#include "furi.h"
#include "graphics_i.h"
#include "partitions.h"
#include "services/gui/gui.h"
#include "tactility.h"
#define TAG "nanobake"
#define TAG "tactility"
Gui* gui_alloc();
@@ -66,13 +66,13 @@ static void start_user_services(const Config* _Nonnull config) {
FURI_LOG_I(TAG, "User services started");
}
__attribute__((unused)) extern void nanobake_start(const Config* _Nonnull config) {
__attribute__((unused)) extern void tactility_start(const Config* _Nonnull config) {
furi_init();
nb_partitions_init();
tt_partitions_init();
Hardware hardware = nb_hardware_init(config->hardware);
/*NbLvgl lvgl =*/nb_graphics_init(&hardware);
Hardware hardware = tt_hardware_init(config->hardware);
/*NbLvgl lvgl =*/tt_graphics_init(&hardware);
// Register all apps
register_system_apps();
@@ -34,10 +34,7 @@ typedef struct {
const ServiceManifest* const services[CONFIG_SERVICES_LIMIT];
} Config;
__attribute__((unused)) extern void nanobake_start(const Config _Nonnull* config);
FuriThreadId nanobake_get_app_thread_id(size_t index);
size_t nanobake_get_app_thread_count();
__attribute__((unused)) extern void tactility_start(const Config _Nonnull* config);
#ifdef __cplusplus
}
@@ -1,7 +1,7 @@
#include "check.h"
#include "touch.h"
TouchDevice _Nonnull* nb_touch_alloc(TouchDriver _Nonnull* driver) {
TouchDevice _Nonnull* tt_touch_alloc(TouchDriver _Nonnull* driver) {
TouchDevice _Nonnull* touch = malloc(sizeof(TouchDevice));
bool success = driver->create_touch_device(
&(touch->io_handle),
@@ -23,7 +23,7 @@ typedef struct {
* @param[in] driver
* @return a newly allocated instance
*/
TouchDevice _Nonnull* nb_touch_alloc(TouchDriver _Nonnull* driver);
TouchDevice _Nonnull* tt_touch_alloc(TouchDriver _Nonnull* driver);
#ifdef __cplusplus
}