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
1 changed files with 8 additions and 0 deletions

View File

@ -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;
}