From 4b7e9ca7c92e2592324a250b5e29fb2b4c0cb8e4 Mon Sep 17 00:00:00 2001 From: julian T Date: Sun, 30 Dec 2018 20:11:36 +0100 Subject: Fixed redrawing --- drawing.ino | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'drawing.ino') diff --git a/drawing.ino b/drawing.ino index 35a8586..12cb9b3 100644 --- a/drawing.ino +++ b/drawing.ino @@ -31,23 +31,19 @@ void clearBuffer(uint8_t layer[] ) { * device: Which screen * where: It render the next 8 bytes from this index */ -void render(int display, unsigned int where) { +void render(int display, unsigned int where, bool clean) { static uint8_t onScreen[BUFF_HEIGHT]; - static unsigned long reRenderLast; int i; uint8_t toWrite; - /* Completely rerender every one second */ - bool reRender = (millis() - reRenderLast ) > REDRAW_TIME; - /* Will draw 8 lines from /where/. */ for(i = where; i < (where + 8); i++) { toWrite = topLayer[i] | buttonLayer[i]; /* Check if whats on screen is the same */ - if(onScreen[i] == toWrite && !reRender) + if(onScreen[i] == toWrite && !clean) continue; writeCommand(display, maxDIGIT_0 + i - where, toWrite); @@ -55,10 +51,6 @@ void render(int display, unsigned int where) { /* Keep track of whats on screen */ onScreen[i] = toWrite; } - - if(reRender) - reRenderLast = millis(); - } /* Renders all 16 bytes to screen */ -- cgit v1.2.3