Skip to content

Commit ffc488e

Browse files
committed
framebufferio: Fix crash calling unimplemented get_brightness
If set_brightness was implemented but get_brightness wasn't, this would hard fault
1 parent 32fc8b0 commit ffc488e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shared-module/framebufferio/FramebufferDisplay.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ bool common_hal_framebufferio_framebufferdisplay_set_auto_brightness(framebuffer
109109
}
110110

111111
mp_float_t common_hal_framebufferio_framebufferdisplay_get_brightness(framebufferio_framebufferdisplay_obj_t* self) {
112-
if (self->framebuffer_protocol->set_brightness) {
112+
if (self->framebuffer_protocol->get_brightness) {
113113
return self->framebuffer_protocol->get_brightness(self->framebuffer);
114114
}
115115
return -1;

0 commit comments

Comments
 (0)