ss_oled update (now working)
This commit is contained in:
1 parent
c65c32275e
commit
6d7b392620
2 files changed
+8
-8
No files matched your search
+6
-7
@@ -57,6 +57,7 @@ const char *printmonth[] = {"xxx", "Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
|
||||
uint8_t DisplayIsOn = 0;
|
||||
uint8_t displaybuf[DISPLAY_WIDTH * DISPLAY_HEIGHT / 8] = {0};
|
||||
static uint8_t plotbuf[DISPLAY_WIDTH * DISPLAY_HEIGHT / 8] = {0};
|
||||
|
||||
QRCode qrcode;
|
||||
|
||||
@@ -298,7 +299,7 @@ void draw_page(time_t t, uint8_t page) {
|
||||
|
||||
// page 1: pax graph
|
||||
case 1:
|
||||
oledDumpBuffer(displaybuf);
|
||||
oledDumpBuffer(plotbuf);
|
||||
break; // page1
|
||||
|
||||
// page 2: GPS
|
||||
@@ -502,24 +503,22 @@ void oledPlotCurve(uint16_t count, bool reset) {
|
||||
if (col < DISPLAY_WIDTH - 1) // matrix not full -> increment column
|
||||
col++;
|
||||
else // matrix full -> scroll left 1 dot
|
||||
oledScrollBufferHorizontal(displaybuf, DISPLAY_WIDTH, DISPLAY_HEIGHT,
|
||||
true);
|
||||
oledScrollBufferHorizontal(plotbuf, DISPLAY_WIDTH, DISPLAY_HEIGHT, true);
|
||||
|
||||
} else // clear current dot
|
||||
oledDrawPixel(displaybuf, col, row, 0);
|
||||
oledDrawPixel(plotbuf, col, row, 0);
|
||||
|
||||
// scroll down, if necessary
|
||||
while ((count - v_scroll) > DISPLAY_HEIGHT - 1)
|
||||
v_scroll++;
|
||||
if (v_scroll)
|
||||
oledScrollBufferVertical(displaybuf, DISPLAY_WIDTH, DISPLAY_HEIGHT,
|
||||
v_scroll);
|
||||
oledScrollBufferVertical(plotbuf, DISPLAY_WIDTH, DISPLAY_HEIGHT, v_scroll);
|
||||
|
||||
// set new dot
|
||||
// row = DISPLAY_HEIGHT - 1 - (count - v_scroll) % DISPLAY_HEIGHT;
|
||||
row = DISPLAY_HEIGHT - 1 - count - v_scroll;
|
||||
last_count = count;
|
||||
oledDrawPixel(displaybuf, col, row, 1);
|
||||
oledDrawPixel(plotbuf, col, row, 1);
|
||||
}
|
||||
|
||||
#endif // HAS_DISPLAY
|
||||
Reference in new issue
Block a user