1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-18 21:48:13 +00:00

trezor.ui.display: fix orientation/backlight calls when NOUI=1 is used

This commit is contained in:
Pavol Rusnak 2016-11-06 18:14:23 +01:00
parent 161bb90e03
commit 0012883984
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -27,11 +27,19 @@ void display_refresh(void)
int display_orientation(int degrees) int display_orientation(int degrees)
{ {
if (degrees != ORIENTATION) {
if (degrees == 0 || degrees == 90 || degrees == 180 || degrees == 270) {
ORIENTATION = degrees;
}
}
return ORIENTATION; return ORIENTATION;
} }
int display_backlight(int val) int display_backlight(int val)
{ {
if (BACKLIGHT != val && val >= 0 && val <= 255) {
BACKLIGHT = val;
}
return BACKLIGHT; return BACKLIGHT;
} }