From 001288398448895ae109b9880dfb01ddda9daecc Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sun, 6 Nov 2016 18:14:23 +0100 Subject: [PATCH] trezor.ui.display: fix orientation/backlight calls when NOUI=1 is used --- extmod/modtrezorui/display-unix-null.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extmod/modtrezorui/display-unix-null.h b/extmod/modtrezorui/display-unix-null.h index d10af2b61..daed75413 100644 --- a/extmod/modtrezorui/display-unix-null.h +++ b/extmod/modtrezorui/display-unix-null.h @@ -27,11 +27,19 @@ void display_refresh(void) int display_orientation(int degrees) { + if (degrees != ORIENTATION) { + if (degrees == 0 || degrees == 90 || degrees == 180 || degrees == 270) { + ORIENTATION = degrees; + } + } return ORIENTATION; } int display_backlight(int val) { + if (BACKLIGHT != val && val >= 0 && val <= 255) { + BACKLIGHT = val; + } return BACKLIGHT; }