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

Method setupDisplay

Tactility/Source/app/boot/Boot.cpp:54–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52 );
53
54 static void setupDisplay() {
55 const auto hal_display = getHalDisplay();
56 if (hal_display == nullptr) {
57 return;
58 }
59
60 settings::display::DisplaySettings settings;
61 if (settings::display::load(settings)) {
62 if (hal_display->getGammaCurveCount() > 0) {
63 hal_display->setGammaCurve(settings.gammaCurve);
64 LOGGER.info("Gamma curve {}", settings.gammaCurve);
65 }
66 } else {
67 settings = settings::display::getDefault();
68 }
69
70 if (hal_display->supportsBacklightDuty()) {
71 LOGGER.info("Backlight {}", settings.backlightDuty);
72 hal_display->setBacklightDuty(settings.backlightDuty);
73 } else {
74 LOGGER.info("No backlight");
75 }
76 }
77
78 static bool setupUsbBootMode() {
79 if (!hal::usb::isUsbBootMode()) {

Callers

nothing calls this directly

Calls 8

infoMethod · 0.80
getHalDisplayFunction · 0.70
loadFunction · 0.50
getDefaultFunction · 0.50
getGammaCurveCountMethod · 0.45
setGammaCurveMethod · 0.45
supportsBacklightDutyMethod · 0.45
setBacklightDutyMethod · 0.45

Tested by

no test coverage detected