mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
Fix for T-Deck apps not showing up and added new kernel functionality
This commit is contained in:
parent
e750ec1919
commit
e017b7415f
@ -32,6 +32,7 @@
|
||||
#include <tactility/lvgl_module.h>
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
#include "tactility/drivers/root.h"
|
||||
#include <Tactility/InitEsp.h>
|
||||
#endif
|
||||
|
||||
@ -61,8 +62,6 @@ namespace service {
|
||||
namespace statusbar { extern const ServiceManifest manifest; }
|
||||
#ifdef ESP_PLATFORM
|
||||
namespace displayidle { extern const ServiceManifest manifest; }
|
||||
#endif
|
||||
#if defined(ESP_PLATFORM) && defined(CONFIG_TT_DEVICE_LILYGO_TDECK)
|
||||
namespace keyboardidle { extern const ServiceManifest manifest; }
|
||||
#endif
|
||||
#if TT_FEATURE_SCREENSHOT_ENABLED
|
||||
@ -112,11 +111,8 @@ namespace app {
|
||||
#ifdef ESP_PLATFORM
|
||||
namespace crashdiagnostics { extern const AppManifest manifest; }
|
||||
namespace webserversettings { extern const AppManifest manifest; }
|
||||
#endif
|
||||
|
||||
#if defined(ESP_PLATFORM) && defined(CONFIG_TT_DEVICE_LILYGO_TDECK)
|
||||
namespace keyboardsettings { extern const AppManifest manifest; }
|
||||
namespace trackballsettings { extern const AppManifest manifest; }
|
||||
namespace keyboardsettings { extern const AppManifest manifest; } // T-Deck only for now
|
||||
namespace trackballsettings { extern const AppManifest manifest; } // T-Deck only for now
|
||||
#endif
|
||||
|
||||
#if TT_FEATURE_SCREENSHOT_ENABLED
|
||||
@ -162,11 +158,13 @@ static void registerInternalApps() {
|
||||
addAppManifest(app::webserversettings::manifest);
|
||||
addAppManifest(app::crashdiagnostics::manifest);
|
||||
addAppManifest(app::development::manifest);
|
||||
#endif
|
||||
|
||||
#if defined(ESP_PLATFORM) && defined(CONFIG_TT_DEVICE_LILYGO_TDECK)
|
||||
addAppManifest(app::keyboardsettings::manifest);
|
||||
addAppManifest(app::trackballsettings::manifest);
|
||||
// T-Deck only:
|
||||
auto* root_device = device_find_by_name("/");
|
||||
check(root_device);
|
||||
if (root_is_model(root_device, "LilyGO T-Deck")) {
|
||||
addAppManifest(app::keyboardsettings::manifest);
|
||||
addAppManifest(app::trackballsettings::manifest);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_TINYUSB_MSC_ENABLED) && CONFIG_TINYUSB_MSC_ENABLED
|
||||
@ -251,13 +249,16 @@ static void registerAndStartSecondaryServices() {
|
||||
addService(service::loader::manifest);
|
||||
addService(service::gui::manifest);
|
||||
addService(service::statusbar::manifest);
|
||||
addService(service::memorychecker::manifest);
|
||||
#ifdef ESP_PLATFORM
|
||||
addService(service::displayidle::manifest);
|
||||
// T-Deck only:
|
||||
auto* root_device = device_find_by_name("/");
|
||||
check(root_device);
|
||||
if (root_is_model(root_device, "LilyGO T-Deck")) {
|
||||
addService(service::keyboardidle::manifest);
|
||||
}
|
||||
#endif
|
||||
#if defined(ESP_PLATFORM) && defined(CONFIG_TT_DEVICE_LILYGO_TDECK)
|
||||
addService(service::keyboardidle::manifest);
|
||||
#endif
|
||||
addService(service::memorychecker::manifest);
|
||||
#if TT_FEATURE_SCREENSHOT_ENABLED
|
||||
addService(service::screenshot::manifest);
|
||||
#endif
|
||||
|
||||
@ -178,6 +178,14 @@ struct Device* device_get_parent(struct Device* device);
|
||||
*/
|
||||
bool device_is_ready(const struct Device* device);
|
||||
|
||||
/**
|
||||
* Indicates whether the device is compatible with the given compatible string.
|
||||
* @param[in] device non-null device pointer
|
||||
* @param[in] compatible compatible string
|
||||
* @return true if the device is compatible
|
||||
*/
|
||||
bool device_is_compatible(const struct Device* device, const char* compatible);
|
||||
|
||||
/**
|
||||
* Set the driver data for a device.
|
||||
*
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -10,6 +12,14 @@ struct RootConfig {
|
||||
const char* model;
|
||||
};
|
||||
|
||||
/**
|
||||
* Indicates whether the device's model matches the specified model.
|
||||
* @param[in] device the device to check (non-null)
|
||||
* @param[in] model the model to check against
|
||||
* @return true if the device's model matches the specified model'
|
||||
*/
|
||||
bool root_is_model(const struct Device* device, const char* model);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -23,6 +23,7 @@ typedef int error_t;
|
||||
#define ERROR_OUT_OF_MEMORY 9
|
||||
#define ERROR_NOT_SUPPORTED 10
|
||||
#define ERROR_NOT_ALLOWED 11
|
||||
#define ERROR_BUFFER_OVERFLOW 12
|
||||
|
||||
/** Convert an error_t to a human-readable text. Useful for logging. */
|
||||
const char* error_to_string(error_t error);
|
||||
|
||||
@ -277,6 +277,11 @@ bool device_is_ready(const struct Device* device) {
|
||||
return device->internal->state.started;
|
||||
}
|
||||
|
||||
bool device_is_compatible(const struct Device* device, const char* compatible) {
|
||||
if (device->internal->driver == nullptr) return false;
|
||||
return driver_is_compatible(device->internal->driver, compatible);
|
||||
}
|
||||
|
||||
void device_set_driver_data(struct Device* device, void* driver_data) {
|
||||
device->internal->driver_data = driver_data;
|
||||
}
|
||||
|
||||
@ -1,10 +1,16 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/driver.h>
|
||||
#include <tactility/drivers/root.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
bool root_is_model(const struct Device* device, const char* buffer) {
|
||||
auto* config = static_cast<const RootConfig*>(device->config);
|
||||
return strcmp(config->model, buffer) == 0;
|
||||
}
|
||||
|
||||
Driver root_driver = {
|
||||
.name = "root",
|
||||
.compatible = (const char*[]) { "root", nullptr },
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
#include <tactility/drivers/gpio_controller.h>
|
||||
#include <tactility/drivers/i2c_controller.h>
|
||||
#include <tactility/drivers/i2s_controller.h>
|
||||
#include <tactility/drivers/root.h>
|
||||
#include <tactility/drivers/spi_controller.h>
|
||||
#include <tactility/drivers/uart_controller.h>
|
||||
#include <tactility/concurrent/dispatcher.h>
|
||||
@ -36,6 +37,7 @@ const struct ModuleSymbol KERNEL_SYMBOLS[] = {
|
||||
DEFINE_MODULE_SYMBOL(device_get_driver_data),
|
||||
DEFINE_MODULE_SYMBOL(device_is_added),
|
||||
DEFINE_MODULE_SYMBOL(device_is_ready),
|
||||
DEFINE_MODULE_SYMBOL(device_is_compatible),
|
||||
DEFINE_MODULE_SYMBOL(device_lock),
|
||||
DEFINE_MODULE_SYMBOL(device_try_lock),
|
||||
DEFINE_MODULE_SYMBOL(device_unlock),
|
||||
@ -79,6 +81,8 @@ const struct ModuleSymbol KERNEL_SYMBOLS[] = {
|
||||
DEFINE_MODULE_SYMBOL(i2s_controller_get_config),
|
||||
DEFINE_MODULE_SYMBOL(i2s_controller_reset),
|
||||
DEFINE_MODULE_SYMBOL(I2S_CONTROLLER_TYPE),
|
||||
// drivers/root
|
||||
DEFINE_MODULE_SYMBOL(root_is_model),
|
||||
// drivers/spi_controller
|
||||
DEFINE_MODULE_SYMBOL(spi_controller_lock),
|
||||
DEFINE_MODULE_SYMBOL(spi_controller_try_lock),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user