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:
parent
b0ffa04d78
commit
28bd80c1f1
@ -16,4 +16,4 @@ if(NOT "${IDF_TARGET}" STREQUAL "esp32s3")
|
||||
endif()
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(NanoBake)
|
||||
project(Tactility)
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
## Overview
|
||||
|
||||
NanoBake is a front-end application platform for ESP32.
|
||||
Tactility is a front-end application platform for ESP32. It is mainly intended for touchscreen devices.
|
||||
It provides an application framework that is based on code from the [Flipper Zero](https://github.com/flipperdevices/flipperzero-firmware/) project.
|
||||
|
||||
Nanobake provides:
|
||||
Tactility provides:
|
||||
- A hardware abstraction layer
|
||||
- UI capabilities (via LVGL)
|
||||
- An application platform that can run apps and services
|
||||
@ -40,7 +40,7 @@ Other configurations can be supported, but they require you to set up the driver
|
||||
|
||||
Until there is proper documentation, here are some pointers:
|
||||
- Sample application: [bootstrap](main/src/main.c) and [app](main/src/hello_world/hello_world.c)
|
||||
- [NanoBake](./components/nanobake/): the main platform with default services and apps
|
||||
- [Tactility](./components/tactility/): the main platform with default services and apps
|
||||
- [Furi](./components/furi/): the core platform code, based on Flipper Zero firmware
|
||||
|
||||
## Building Firmware
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
idf_component_register(
|
||||
SRC_DIRS "."
|
||||
INCLUDE_DIRS "."
|
||||
REQUIRES nanobake esp_lcd esp_lcd_touch_gt911
|
||||
REQUIRES tactility esp_lcd esp_lcd_touch_gt911
|
||||
)
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
#include "nanobake.h"
|
||||
#include "esp_log.h"
|
||||
#include "driver/ledc.h"
|
||||
#include "driver/spi_master.h"
|
||||
#include "esp_err.h"
|
||||
#include "esp_lcd_panel_ops.h"
|
||||
#include "driver/spi_master.h"
|
||||
#include "esp_lcd_panel_vendor.h"
|
||||
#include "driver/ledc.h"
|
||||
#include "esp_log.h"
|
||||
#include "tactility.h"
|
||||
|
||||
#define TAG "lilygo_tdeck_display"
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include "nanobake.h"
|
||||
#include "tactility.h"
|
||||
|
||||
extern const HardwareConfig lilygo_tdeck;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "nanobake.h"
|
||||
#include "tactility.h"
|
||||
|
||||
#include "esp_lcd_touch_gt911.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
idf_component_register(
|
||||
SRC_DIRS "."
|
||||
INCLUDE_DIRS "."
|
||||
REQUIRES nanobake esp_lcd_touch_cst816s esp_lcd_ili9341
|
||||
REQUIRES tactility esp_lcd_touch_cst816s esp_lcd_ili9341
|
||||
)
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
#include "nanobake.h"
|
||||
#include "esp_lcd_ili9341.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_err.h"
|
||||
#include "esp_lcd_panel_ops.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "driver/spi_master.h"
|
||||
#include "esp_err.h"
|
||||
#include "esp_lcd_ili9341.h"
|
||||
#include "esp_lcd_panel_ops.h"
|
||||
#include "esp_log.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/semphr.h"
|
||||
#include "tactility.h"
|
||||
|
||||
#define TAG "2432s024_ili9341"
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
#include "nanobake.h"
|
||||
#include "driver/i2c.h"
|
||||
#include "esp_err.h"
|
||||
#include "esp_lcd_touch_cst816s.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_err.h"
|
||||
#include "driver/i2c.h"
|
||||
#include "tactility.h"
|
||||
|
||||
#define TOUCH_I2C_PORT 0
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "nanobake.h"
|
||||
#include "tactility.h"
|
||||
|
||||
// Capacitive touch version of the 2.4" yellow board
|
||||
extern const HardwareConfig yellow_board_24inch_cap;
|
||||
|
||||
@ -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
components/tactility/src/devices_i.h
Normal file
13
components/tactility/src/devices_i.h
Normal 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
|
||||
}
|
||||
@ -1,5 +1,4 @@
|
||||
# Yellow Board only runs on ESP32
|
||||
set(project_components nanobake)
|
||||
set(project_components tactility)
|
||||
|
||||
if("${IDF_TARGET}" STREQUAL "esp32")
|
||||
list(APPEND project_components yellow_board)
|
||||
|
||||
12
main/Kconfig
12
main/Kconfig
@ -1,14 +1,14 @@
|
||||
# Kconfig file for NanoBake example app
|
||||
menu "NanoBake App"
|
||||
# Kconfig file for Tactility example app
|
||||
menu "Tactility App"
|
||||
choice
|
||||
prompt "Board"
|
||||
default NB_BOARD_CUSTOM
|
||||
default TT_BOARD_CUSTOM
|
||||
|
||||
config NB_BOARD_CUSTOM
|
||||
config TT_BOARD_CUSTOM
|
||||
bool "Custom"
|
||||
config NB_BOARD_YELLOW_BOARD_24_CAP
|
||||
config TT_BOARD_YELLOW_BOARD_24_CAP
|
||||
bool "Yellow Board (2.4\" capacitive)"
|
||||
config NB_BOARD_LILYGO_TDECK
|
||||
config TT_BOARD_LILYGO_TDECK
|
||||
bool "LilyGo T-Deck"
|
||||
endchoice
|
||||
endmenu
|
||||
|
||||
@ -4,4 +4,4 @@ dependencies:
|
||||
espressif/esp_lcd_touch_gt911: "^1.0.0"
|
||||
espressif/esp_lcd_touch: "1.1.1"
|
||||
esp_lvgl_port: '1.4.0'
|
||||
idf: '>=5.1'
|
||||
idf: '>=5.1.2'
|
||||
|
||||
@ -1,14 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "sdkconfig.h"
|
||||
|
||||
// Supported hardware:
|
||||
#if defined(CONFIG_NB_BOARD_LILYGO_TDECK)
|
||||
#if defined(CONFIG_TT_BOARD_LILYGO_TDECK)
|
||||
#include "lilygo_tdeck.h"
|
||||
#define NB_BOARD_HARDWARE &lilygo_tdeck
|
||||
#elif defined(CONFIG_NB_BOARD_YELLOW_BOARD_24_CAP)
|
||||
#define TT_BOARD_HARDWARE &lilygo_tdeck
|
||||
#elif defined(CONFIG_TT_BOARD_YELLOW_BOARD_24_CAP)
|
||||
#include "yellow_board.h"
|
||||
#define NB_BOARD_HARDWARE &yellow_board_24inch_cap
|
||||
#elif defined(CONFIG_NB_BOARD_CUSTOM)
|
||||
#define NB_BOARD_HARDWARE furi_crash( \
|
||||
"Replace NB_BOARD_HARDWARE in main.c with your own, or use \"idf.py menuconfig\" to select a supported board." \
|
||||
)
|
||||
#define TT_BOARD_HARDWARE &yellow_board_24inch_cap
|
||||
#else
|
||||
#define TT_BOARD_HARDWARE NULL
|
||||
#error Replace TT_BOARD_HARDWARE in main.c with your own. Or copy one of the ./sdkconfig.board.* files into ./sdkconfig.
|
||||
#endif
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "nanobake.h"
|
||||
#include "tactility.h"
|
||||
#include "board_config.h"
|
||||
|
||||
// Apps
|
||||
@ -10,12 +10,12 @@ __attribute__((unused)) void app_main(void) {
|
||||
* Auto-select a board based on the ./sdkconfig.board.* file
|
||||
* that you copied to ./sdkconfig before you opened this project.
|
||||
*/
|
||||
.hardware = NB_BOARD_HARDWARE,
|
||||
.hardware = TT_BOARD_HARDWARE,
|
||||
.apps = {
|
||||
&hello_world_app
|
||||
},
|
||||
.services = { },
|
||||
};
|
||||
|
||||
nanobake_start(&config);
|
||||
tactility_start(&config);
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||
|
||||
# Hardware defaults
|
||||
CONFIG_NB_BOARD_LILYGO_TDECK=y
|
||||
CONFIG_TT_BOARD_LILYGO_TDECK=y
|
||||
CONFIG_IDF_TARGET="esp32s3"
|
||||
CONFIG_LV_COLOR_16_SWAP=y
|
||||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
|
||||
|
||||
@ -14,7 +14,7 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||
|
||||
# Hardware defaults
|
||||
CONFIG_NB_BOARD_YELLOW_BOARD_24_CAP=y
|
||||
CONFIG_TT_BOARD_YELLOW_BOARD_24_CAP=y
|
||||
CONFIG_IDF_TARGET="esp32"
|
||||
CONFIG_LV_COLOR_16_SWAP=y
|
||||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
|
||||
|
||||
@ -16,4 +16,4 @@ CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||
CONFIG_FREERTOS_UNICORE=y
|
||||
|
||||
# Hardware defaults
|
||||
CONFIG_NB_BOARD_CUSTOM=y
|
||||
CONFIG_TT_BOARD_CUSTOM=y
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user