| 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()) { |
nothing calls this directly
no test coverage detected