From 505df38a84b157d1f4d893db303a19cbe8926f32 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Thu, 19 Jan 2017 16:16:57 +0100 Subject: [PATCH] fix when oled triangle is shown --- firmware/trezor.c | 5 +---- oled.c | 10 +++++----- oled.h | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/firmware/trezor.c b/firmware/trezor.c index 6e491691a..56c74d491 100644 --- a/firmware/trezor.c +++ b/firmware/trezor.c @@ -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(); diff --git a/oled.c b/oled.c index 926428e77..095bb02fd 100644 --- a/oled.c +++ b/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(); } diff --git a/oled.h b/oled.h index 6fccc363a..05b8b0b37 100644 --- a/oled.h +++ b/oled.h @@ -34,7 +34,7 @@ void oledInit(void); void oledClear(void); void oledRefresh(void); -void oledSetDebug(bool set); +void oledSetDebugLink(bool set); void oledSetBuffer(uint8_t *buf); const uint8_t *oledGetBuffer(void); void oledDrawPixel(int x, int y);