mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-08-21 01:15:05 +00:00
Fix for build
This commit is contained in:
parent
6986cbd1c5
commit
6772fd5059
@ -97,15 +97,16 @@ static constexpr BacklightApi PWM_BACKLIGHT_API = {
|
|||||||
// region Driver lifecycle
|
// region Driver lifecycle
|
||||||
|
|
||||||
static error_t start(Device* device) {
|
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 };
|
auto* internal = new(std::nothrow) PwmBacklightInternal { .brightness = GET_CONFIG(device)->brightness_range.min };
|
||||||
if (internal == nullptr) {
|
if (internal == nullptr) {
|
||||||
return ERROR_OUT_OF_MEMORY;
|
return ERROR_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config->brightness_range.max <= config->brightness_range.min) {
|
|
||||||
return ERROR_INVALID_ARGUMENT;
|
|
||||||
}
|
|
||||||
|
|
||||||
device_set_driver_data(device, internal);
|
device_set_driver_data(device, internal);
|
||||||
|
|
||||||
pwm_backlight_set_brightness_default(device); // Allowed to fail, we don't care about the result
|
pwm_backlight_set_brightness_default(device); // Allowed to fail, we don't care about the result
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user