mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 06:48:16 +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();
|
timer_init();
|
||||||
|
|
||||||
#if DEBUG_LOG
|
|
||||||
oledSetDebug(1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if DEBUG_LINK
|
#if DEBUG_LINK
|
||||||
|
oledSetDebugLink(1);
|
||||||
storage_reset(); // wipe storage if debug link
|
storage_reset(); // wipe storage if debug link
|
||||||
storage_reset_uuid();
|
storage_reset_uuid();
|
||||||
storage_commit();
|
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))
|
#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 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.
|
* 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};
|
static uint8_t s[3] = {OLED_SETLOWCOLUMN | 0x00, OLED_SETHIGHCOLUMN | 0x00, OLED_SETSTARTLINE | 0x00};
|
||||||
|
|
||||||
// draw triangle in upper right corner
|
// 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 - 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 - 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);
|
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
|
gpio_clear(OLED_DC_PORT, OLED_DC_PIN); // set to CMD
|
||||||
|
|
||||||
// return it back
|
// 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 - 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 - 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);
|
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;
|
return _oledbuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void oledSetDebug(bool set)
|
void oledSetDebugLink(bool set)
|
||||||
{
|
{
|
||||||
is_debug_mode = set;
|
is_debug_link = set;
|
||||||
oledRefresh();
|
oledRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
oled.h
2
oled.h
@ -34,7 +34,7 @@ void oledInit(void);
|
|||||||
void oledClear(void);
|
void oledClear(void);
|
||||||
void oledRefresh(void);
|
void oledRefresh(void);
|
||||||
|
|
||||||
void oledSetDebug(bool set);
|
void oledSetDebugLink(bool set);
|
||||||
void oledSetBuffer(uint8_t *buf);
|
void oledSetBuffer(uint8_t *buf);
|
||||||
const uint8_t *oledGetBuffer(void);
|
const uint8_t *oledGetBuffer(void);
|
||||||
void oledDrawPixel(int x, int y);
|
void oledDrawPixel(int x, int y);
|
||||||
|
Loading…
Reference in New Issue
Block a user