Move Config back to tactility project (#15)

This commit is contained in:
Ken Van Hoeylandt
2024-01-20 16:23:33 +01:00
committed by GitHub
parent e2209ccba8
commit 18a5c5aa45
11 changed files with 601 additions and 435 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include "devices.h"
#include "graphics.h"
#include "hardare.h"
#ifdef __cplusplus
extern "C" {
@@ -1,5 +1,5 @@
#include "check.h"
#include "devices_i.h"
#include "hardware_i.h"
#include "touch.h"
#define TAG "hardware"
+16 -18
View File
@@ -1,16 +1,15 @@
#include "tactility.h"
#include "esp_event.h"
#include "esp_lvgl_port.h"
#include "esp_netif.h"
#include "graphics_i.h"
#include "devices_i.h" // TODO: Rename to hardware*.*
#include "hardware_i.h" // TODO: Rename to hardware*.*
#include "nvs_flash.h"
#include "partitions.h"
#include "esp_lvgl_port.h"
#include "ui/lvgl_sync.h"
#include "services/wifi/wifi_credentials.h"
#include "services/loader/loader.h"
#include <sys/cdefs.h>
#include "esp_netif.h"
#include "esp_event.h"
#include "services/wifi/wifi_credentials.h"
#include "ui/lvgl_sync.h"
#define TAG "tactility"
@@ -22,7 +21,7 @@ static void lvgl_unlock_impl() {
lvgl_port_unlock();
}
void tt_esp_init(const Config* _Nonnull config) {
void tt_esp_init(const HardwareConfig* hardware_config) {
// Initialize NVS
esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
@@ -36,14 +35,13 @@ void tt_esp_init(const Config* _Nonnull config) {
// Network interface
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default());
tt_partitions_init();
tt_wifi_credentials_init();
tt_lvgl_sync_set(&lvgl_lock_impl, &lvgl_unlock_impl);
Hardware hardware = tt_hardware_init(config->hardware);
/*NbLvgl lvgl =*/tt_graphics_init(&hardware);
}
tt_partitions_init();
tt_wifi_credentials_init();
tt_lvgl_sync_set(&lvgl_lock_impl, &lvgl_unlock_impl);
Hardware hardware = tt_hardware_init(hardware_config);
/*Lvgl lvgl =*/tt_graphics_init(&hardware);
}
+3 -14
View File
@@ -1,23 +1,19 @@
#pragma once
#include "hardare.h"
#include "tactility.h"
#include "devices.h"
#ifdef __cplusplus
extern "C" {
#endif
#define CONFIG_APPS_LIMIT 32
#define CONFIG_SERVICES_LIMIT 32
// Forward declarations
typedef void* ThreadId;
typedef void (*Bootstrap)();
typedef TouchDriver (*CreateTouchDriver)();
typedef DisplayDriver (*CreateDisplayDriver)();
typedef struct {
// Optional bootstrapping method
// Optional bootstrapping method (e.g. to turn peripherals on)
const Bootstrap _Nullable bootstrap;
// Required driver for display
const CreateDisplayDriver _Nonnull display_driver;
@@ -25,15 +21,8 @@ typedef struct {
const CreateTouchDriver _Nullable touch_driver;
} HardwareConfig;
typedef struct {
const HardwareConfig* hardware;
// List of user applications
const AppManifest* const apps[CONFIG_APPS_LIMIT];
const ServiceManifest* const services[CONFIG_SERVICES_LIMIT];
const char* auto_start_app_id;
} Config;
void tt_esp_init(const Config* _Nonnull config);
void tt_esp_init(const HardwareConfig* hardware_config);
#ifdef __cplusplus
}