fix when oled triangle is shown

pull/25/head
Pavol Rusnak 7 years ago
parent 3b10958113
commit 505df38a84
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -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();

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

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

Loading…
Cancel
Save