diff --git a/Firmware/Kconfig b/Firmware/Kconfig index 393e75e2..548887e8 100644 --- a/Firmware/Kconfig +++ b/Firmware/Kconfig @@ -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 diff --git a/Tactility/Source/Tactility.cpp b/Tactility/Source/Tactility.cpp index 942a9dcb..976064c6 100644 --- a/Tactility/Source/Tactility.cpp +++ b/Tactility/Source/Tactility.cpp @@ -111,9 +111,11 @@ 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 +#endif #if TT_FEATURE_SCREENSHOT_ENABLED namespace screenshot { extern const AppManifest manifest; } @@ -158,13 +160,10 @@ static void registerInternalApps() { addAppManifest(app::webserversettings::manifest); addAppManifest(app::crashdiagnostics::manifest); addAppManifest(app::development::manifest); - // T-Deck only: - auto* root_device = device_find_by_name("/"); - check(root_device); - if (root_is_model(root_device, "LilyGO T-Deck")) { +#if defined(CONFIG_TT_TDECK_WORKAROUND) addAppManifest(app::keyboardsettings::manifest); addAppManifest(app::trackballsettings::manifest); - } +#endif #endif #if defined(CONFIG_TINYUSB_MSC_ENABLED) && CONFIG_TINYUSB_MSC_ENABLED @@ -250,14 +249,11 @@ static void registerAndStartSecondaryServices() { addService(service::gui::manifest); addService(service::statusbar::manifest); addService(service::memorychecker::manifest); -#ifdef ESP_PLATFORM +#if defined(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); - } +#if defined(CONFIG_TT_TDECK_WORKAROUND) + addService(service::keyboardidle::manifest); +#endif #endif #if TT_FEATURE_SCREENSHOT_ENABLED addService(service::screenshot::manifest); diff --git a/device.py b/device.py index 3048fcc0..a68cbfed 100644 --- a/device.py +++ b/device.py @@ -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()