From fe7fdd858328fcbe960a64d21f07785718c2213f Mon Sep 17 00:00:00 2001 From: Ken Van Hoeylandt Date: Sun, 7 Sep 2025 12:47:58 +0200 Subject: [PATCH] Fix HAL init when touch isn't configured (#325) --- Tactility/Source/hal/Hal.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Tactility/Source/hal/Hal.cpp b/Tactility/Source/hal/Hal.cpp index 8b379fff..4ee6a6ea 100644 --- a/Tactility/Source/hal/Hal.cpp +++ b/Tactility/Source/hal/Hal.cpp @@ -59,23 +59,28 @@ void registerDevices(const Configuration& configuration) { } static void startDisplays() { - TT_LOG_I(TAG, "Start displays"); + TT_LOG_I(TAG, "Starting displays & touch"); auto displays = hal::findDevices(Device::Type::Display); for (auto& display : displays) { + TT_LOG_I(TAG, "%s starting", display->getName().c_str()); if (!display->start()) { - TT_LOG_E(TAG, "Display start failed"); + TT_LOG_E(TAG, "%s start failed", display->getName().c_str()); } else { - TT_LOG_I(TAG, "Started %s", display->getName().c_str()); + TT_LOG_I(TAG, "%s started", display->getName().c_str()); if (display->supportsBacklightDuty()) { + TT_LOG_I(TAG, "Setting backlight"); display->setBacklightDuty(0); } auto touch = display->getTouchDevice(); - if (touch != nullptr && !touch->start()) { - TT_LOG_E(TAG, "Touch start failed"); - } else { - TT_LOG_I(TAG, "Started %s", touch->getName().c_str()); + if (touch != nullptr) { + TT_LOG_I(TAG, "%s starting", touch->getName().c_str()); + if (!touch->start()) { + TT_LOG_E(TAG, "%s start failed", touch->getName().c_str()); + } else { + TT_LOG_I(TAG, "%s started", touch->getName().c_str()); + } } } }