Device cleanup (#592)

- Replaced device_find_\* usage by device_get_\* variants.
- Removed deprecated device_find_\* functions.
- Improved reliability of Bluetooth scanning, pairing, connection, and HID host lifecycle behavior, including peer auto-connect handling.
- Improved Bluetooth/USB status indicators and clarified “Eject failed” alerts with the affected mount path.
This commit is contained in:
Ken Van Hoeylandt
2026-07-27 17:29:12 +02:00
committed by GitHub
parent 3354924359
commit d1f06cb774
20 changed files with 328 additions and 204 deletions
@@ -25,15 +25,18 @@ namespace tt::app::kerneldisplay {
constexpr auto* TAG = "KernelDisplay";
static Device* getBacklightDevice() {
Device* display = device_find_first_by_type(&DISPLAY_TYPE);
check(display);
Device* display;
check(device_get_first_by_type(&DISPLAY_TYPE, &display) == ERROR_NONE);
// Boards not yet migrated to the kernel display driver register a placeholder device (so the
// devicetree node resolves) with a NULL api - nothing for display_get_backlight() to act on.
if (device_get_driver(display)->api == nullptr) {
device_put(display);
return nullptr;
}
Device* backlight = nullptr;
return display_get_backlight(display, &backlight) == ERROR_NONE ? backlight : nullptr;
display_get_backlight(display, &backlight);
device_put(display);
return backlight;
}
class KernelDisplayApp final : public App {