mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-22 14:28:07 +00:00
fix when oled triangle is shown
This commit is contained in:
parent
3b10958113
commit
505df38a84
@ -99,11 +99,8 @@ int main(void)
|
||||
|
||||
timer_init();
|
||||
|
||||
#if DEBUG_LOG
|
||||
oledSetDebug(1);
|
||||
#endif
|
||||
|
||||
#if DEBUG_LINK
|
||||
oledSetDebugLink(1);
|
||||
storage_reset(); // wipe storage if debug link
|
||||
storage_reset_uuid();
|
||||
storage_commit();
|
||||
|
10
oled.c
10
oled.c
@ -74,7 +74,7 @@
|
||||
#define OLED_BUFTGL(X,Y) _oledbuffer[OLED_BUFSIZE - 1 - (X) - ((Y)/8)*OLED_WIDTH] ^= (1 << (7 - (Y)%8))
|
||||
|
||||
static uint8_t _oledbuffer[OLED_BUFSIZE];
|
||||
static bool is_debug_mode = 0;
|
||||
static bool is_debug_link = 0;
|
||||
|
||||
/*
|
||||
* Send a block of data via the SPI bus.
|
||||
@ -161,7 +161,7 @@ void oledRefresh()
|
||||
static uint8_t s[3] = {OLED_SETLOWCOLUMN | 0x00, OLED_SETHIGHCOLUMN | 0x00, OLED_SETSTARTLINE | 0x00};
|
||||
|
||||
// draw triangle in upper right corner
|
||||
if (is_debug_mode) {
|
||||
if (is_debug_link) {
|
||||
OLED_BUFTGL(OLED_WIDTH - 5, 0); OLED_BUFTGL(OLED_WIDTH - 4, 0); OLED_BUFTGL(OLED_WIDTH - 3, 0); OLED_BUFTGL(OLED_WIDTH - 2, 0); OLED_BUFTGL(OLED_WIDTH - 1, 0);
|
||||
OLED_BUFTGL(OLED_WIDTH - 4, 1); OLED_BUFTGL(OLED_WIDTH - 3, 1); OLED_BUFTGL(OLED_WIDTH - 2, 1); OLED_BUFTGL(OLED_WIDTH - 1, 1);
|
||||
OLED_BUFTGL(OLED_WIDTH - 3, 2); OLED_BUFTGL(OLED_WIDTH - 2, 2); OLED_BUFTGL(OLED_WIDTH - 1, 2);
|
||||
@ -180,7 +180,7 @@ void oledRefresh()
|
||||
gpio_clear(OLED_DC_PORT, OLED_DC_PIN); // set to CMD
|
||||
|
||||
// return it back
|
||||
if (is_debug_mode) {
|
||||
if (is_debug_link) {
|
||||
OLED_BUFTGL(OLED_WIDTH - 5, 0); OLED_BUFTGL(OLED_WIDTH - 4, 0); OLED_BUFTGL(OLED_WIDTH - 3, 0); OLED_BUFTGL(OLED_WIDTH - 2, 0); OLED_BUFTGL(OLED_WIDTH - 1, 0);
|
||||
OLED_BUFTGL(OLED_WIDTH - 4, 1); OLED_BUFTGL(OLED_WIDTH - 3, 1); OLED_BUFTGL(OLED_WIDTH - 2, 1); OLED_BUFTGL(OLED_WIDTH - 1, 1);
|
||||
OLED_BUFTGL(OLED_WIDTH - 3, 2); OLED_BUFTGL(OLED_WIDTH - 2, 2); OLED_BUFTGL(OLED_WIDTH - 1, 2);
|
||||
@ -194,9 +194,9 @@ const uint8_t *oledGetBuffer()
|
||||
return _oledbuffer;
|
||||
}
|
||||
|
||||
void oledSetDebug(bool set)
|
||||
void oledSetDebugLink(bool set)
|
||||
{
|
||||
is_debug_mode = set;
|
||||
is_debug_link = set;
|
||||
oledRefresh();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user