From ffc488e748890976fe1923c5503300f66064d904 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 31 Jul 2020 14:34:24 -0500 Subject: [PATCH] framebufferio: Fix crash calling unimplemented get_brightness If set_brightness was implemented but get_brightness wasn't, this would hard fault --- shared-module/framebufferio/FramebufferDisplay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 2a90fa0d4a..73917b1a32 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -109,7 +109,7 @@ bool common_hal_framebufferio_framebufferdisplay_set_auto_brightness(framebuffer } mp_float_t common_hal_framebufferio_framebufferdisplay_get_brightness(framebufferio_framebufferdisplay_obj_t* self) { - if (self->framebuffer_protocol->set_brightness) { + if (self->framebuffer_protocol->get_brightness) { return self->framebuffer_protocol->get_brightness(self->framebuffer); } return -1;