MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / startDisplays

Function startDisplays

Tactility/Source/hal/Hal.cpp:35–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35static void startDisplays() {
36 LOGGER.info("Starting displays & touch");
37 auto displays = hal::findDevices<display::DisplayDevice>(Device::Type::Display);
38 for (auto& display : displays) {
39 LOGGER.info("{} starting", display->getName());
40 if (!display->start()) {
41 LOGGER.error("{} start failed", display->getName());
42 } else {
43 LOGGER.info("{} started", display->getName());
44
45 if (display->supportsBacklightDuty()) {
46 LOGGER.info("Setting backlight");
47 display->setBacklightDuty(0);
48 }
49
50 auto touch = display->getTouchDevice();
51 if (touch != nullptr) {
52 LOGGER.info("{} starting", touch->getName());
53 if (!touch->start()) {
54 LOGGER.error("{} start failed", touch->getName());
55 } else {
56 LOGGER.info("{} started", touch->getName());
57 }
58 }
59 }
60 }
61}
62
63void init(const Configuration& configuration) {
64 kernel::publishSystemEvent(kernel::SystemEvent::BootInitHalBegin);

Callers 1

initFunction · 0.85

Calls 7

infoMethod · 0.80
errorMethod · 0.80
getNameMethod · 0.45
startMethod · 0.45
supportsBacklightDutyMethod · 0.45
setBacklightDutyMethod · 0.45
getTouchDeviceMethod · 0.45

Tested by

no test coverage detected