Skip to content

Commit

Permalink
embed/extmod/modtrezorui: properly set backlight and bpp for T1 display
Browse files Browse the repository at this point in the history
  • Loading branch information
prusnak committed Sep 13, 2018
1 parent 204f6b7 commit fb816bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions embed/extmod/modtrezorui/display-unix.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ static struct {
} PIXELWINDOW;

void PIXELDATA(uint16_t c) {
#if TREZOR_MODEL == 1
// set to white if highest bits of all R, G, B values are set to 1
// bin(10000 100000 10000) = hex(0x8410)
// otherwise set to black
c = (c & 0x8410) ? 0xFFFF : 0x0000;
#endif
if (!RENDERER) {
display_init();
}
Expand Down
3 changes: 3 additions & 0 deletions embed/extmod/modtrezorui/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,9 @@ int display_orientation(int degrees)

int display_backlight(int val)
{
#if TREZOR_MODEL == 1
val = 255;
#endif
if (DISPLAY_BACKLIGHT != val && val >= 0 && val <= 255) {
DISPLAY_BACKLIGHT = val;
display_set_backlight(val);
Expand Down

0 comments on commit fb816bd

Please sign in to comment.