Fix for build

This commit is contained in:
Ken Van Hoeylandt 2026-07-16 20:19:23 +02:00
parent 6986cbd1c5
commit 6772fd5059

View File

@ -97,15 +97,16 @@ static constexpr BacklightApi PWM_BACKLIGHT_API = {
// region Driver lifecycle
static error_t start(Device* device) {
const auto* config = GET_CONFIG(device);
if (config->brightness_range.max <= config->brightness_range.min) {
return ERROR_INVALID_ARGUMENT;
}
auto* internal = new(std::nothrow) PwmBacklightInternal { .brightness = GET_CONFIG(device)->brightness_range.min };
if (internal == nullptr) {
return ERROR_OUT_OF_MEMORY;
}
if (config->brightness_range.max <= config->brightness_range.min) {
return ERROR_INVALID_ARGUMENT;
}
device_set_driver_data(device, internal);
pwm_backlight_set_brightness_default(device); // Allowed to fail, we don't care about the result