Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/build-simulator/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runs:
using: "composite"
steps:
- name: "Checkout repo"
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Linux Dependencies for SDL
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout repo"
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
- name: "Configure Project"
Expand All @@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout repo"
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
- name: "Install Python Dependencies"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <St7789Display.h>

static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
// Note for future changes: Reset pin is 48 and interrupt pin is 47
auto configuration = std::make_unique<Ft5x06Touch::Configuration>(
I2C_NUM_0,
LCD_HORIZONTAL_RESOLUTION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <Ili9488Display.h>

static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
// Note for future changes: Reset pin is 48 and interrupt pin is 47
auto configuration = std::make_unique<Gt911Touch::Configuration>(
I2C_NUM_0,
320,
Expand Down
5 changes: 3 additions & 2 deletions Devices/lilygo-tdeck/Source/devices/Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
#include <St7789Display.h>

static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
// Note for future changes: Reset pin is 48 and interrupt pin is 47
auto configuration = std::make_unique<Gt911Touch::Configuration>(
I2C_NUM_0,
240,
320,
true,
true,
false
false,
GPIO_NUM_NC,
GPIO_NUM_16
);

return std::make_shared<Gt911Touch>(std::move(configuration));
Expand Down
1 change: 0 additions & 1 deletion Devices/m5stack-cores3/Source/devices/Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ static void setBacklightDuty(uint8_t backlightDuty) {
}

static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
// Note for future changes: Reset pin is 48 and interrupt pin is 47
auto configuration = std::make_unique<Ft5x06Touch::Configuration>(
I2C_NUM_0,
LCD_HORIZONTAL_RESOLUTION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ constexpr auto LCD_VERTICAL_RESOLUTION = 320;
void setBacklightDuty(uint8_t level);

static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
// Note for future changes: Reset pin is 48 and interrupt pin is 47
auto configuration = std::make_unique<Axs5106Touch::Configuration>(
I2C_NUM_0,
172,
Expand Down
8 changes: 7 additions & 1 deletion Firmware/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ menu "Tactility App"
config TT_DEVICE_ID
string "Device Identifier"
default ""
config TT_SPLASH_DURATION
# T-Deck device-related code was directly referenced from Tactility in a pull request.
# This breaks other devices because the code does not exist in those implementations.
# Until we move it out into a proper driver, we have to have pre-processor definition for that.
config TT_TDECK_WORKAROUND
bool "Temporary work-around until we fix the T-Deck keyboard and trackball settings"
default n
config TT_SPLASH_DURATION
int "Splash Duration (ms)"
default 1000
range 0 3000
Expand Down
2 changes: 1 addition & 1 deletion Firmware/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dependencies:
version: "1.7.6~1"
rules:
- if: "target == esp32s3"
espressif/esp_lvgl_port: "2.7.0"
espressif/esp_lvgl_port: "2.5.0"
lvgl/lvgl: "9.3.0"
FastEPD:
git: https://github.com/bitbank2/FastEPD.git
Expand Down
25 changes: 11 additions & 14 deletions Tactility/Source/Tactility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <tactility/lvgl_module.h>

#ifdef ESP_PLATFORM
#include "tactility/drivers/root.h"
#include <Tactility/InitEsp.h>
#endif

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -112,11 +111,10 @@ namespace app {
#ifdef ESP_PLATFORM
namespace crashdiagnostics { extern const AppManifest manifest; }
namespace webserversettings { extern const AppManifest manifest; }
#if CONFIG_TT_TDECK_WORKAROUND == 1
namespace keyboardsettings { extern const AppManifest manifest; } // T-Deck only for now
namespace trackballsettings { extern const AppManifest manifest; } // T-Deck only for now
#endif

#if defined(ESP_PLATFORM) && defined(CONFIG_TT_DEVICE_LILYGO_TDECK)
namespace keyboardsettings { extern const AppManifest manifest; }
namespace trackballsettings { extern const AppManifest manifest; }
#endif

#if TT_FEATURE_SCREENSHOT_ENABLED
Expand Down Expand Up @@ -162,11 +160,10 @@ static void registerInternalApps() {
addAppManifest(app::webserversettings::manifest);
addAppManifest(app::crashdiagnostics::manifest);
addAppManifest(app::development::manifest);
#if defined(CONFIG_TT_TDECK_WORKAROUND)
addAppManifest(app::keyboardsettings::manifest);
addAppManifest(app::trackballsettings::manifest);
#endif

#if defined(ESP_PLATFORM) && defined(CONFIG_TT_DEVICE_LILYGO_TDECK)
addAppManifest(app::keyboardsettings::manifest);
addAppManifest(app::trackballsettings::manifest);
#endif

#if defined(CONFIG_TINYUSB_MSC_ENABLED) && CONFIG_TINYUSB_MSC_ENABLED
Expand Down Expand Up @@ -251,13 +248,13 @@ static void registerAndStartSecondaryServices() {
addService(service::loader::manifest);
addService(service::gui::manifest);
addService(service::statusbar::manifest);
#ifdef ESP_PLATFORM
addService(service::memorychecker::manifest);
#if defined(ESP_PLATFORM)
addService(service::displayidle::manifest);
#endif
#if defined(ESP_PLATFORM) && defined(CONFIG_TT_DEVICE_LILYGO_TDECK)
#if defined(CONFIG_TT_TDECK_WORKAROUND)
addService(service::keyboardidle::manifest);
#endif
addService(service::memorychecker::manifest);
#endif
#if TT_FEATURE_SCREENSHOT_ENABLED
addService(service::screenshot::manifest);
#endif
Expand Down
8 changes: 8 additions & 0 deletions TactilityKernel/Include/tactility/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
10 changes: 10 additions & 0 deletions TactilityKernel/Include/tactility/drivers/root.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#pragma once

#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif
Expand All @@ -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
1 change: 1 addition & 0 deletions TactilityKernel/Include/tactility/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions TactilityKernel/Source/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
10 changes: 9 additions & 1 deletion TactilityKernel/Source/drivers/root.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
// SPDX-License-Identifier: Apache-2.0

#include <tactility/device.h>
#include <tactility/driver.h>
#include <tactility/drivers/root.h>
#include <cstring>

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 },
.start_device = nullptr,
.stop_device = nullptr,
.api = nullptr,
.device_type = nullptr,
.owner = nullptr
.owner = nullptr,
.internal = nullptr
};

}
2 changes: 2 additions & 0 deletions TactilityKernel/Source/error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const char* error_to_string(error_t error) {
return "not supported";
case ERROR_NOT_ALLOWED:
return "not allowed";
case ERROR_BUFFER_OVERFLOW:
return "buffer overflow";
default:
return "unknown";
}
Expand Down
4 changes: 4 additions & 0 deletions TactilityKernel/Source/kernel_symbols.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down
3 changes: 3 additions & 0 deletions device.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ def write_tactility_variables(output_file, device_properties: ConfigParser, devi
else:
output_file.write(f"CONFIG_TT_DEVICE_NAME=\"{board_vendor} {board_name}\"\n")
output_file.write(f"CONFIG_TT_DEVICE_ID=\"{device_id}\"\n")
if device_id == "lilygo-tdeck":
output_file.write("CONFIG_TT_TDECK_WORKAROUND=y\n")


def write_core_variables(output_file, device_properties: ConfigParser):
idf_target = get_property_or_exit(device_properties, "hardware", "target").lower()
Expand Down