diff options
author | julian T <julian@jtle.dk> | 2018-12-30 20:11:36 +0100 |
---|---|---|
committer | julian T <julian@jtle.dk> | 2018-12-30 20:11:36 +0100 |
commit | 4b7e9ca7c92e2592324a250b5e29fb2b4c0cb8e4 (patch) | |
tree | 12e4d189c92c7e62b86091b3edd67c5eb8400d94 /drawing.ino | |
parent | 6e21069d02b589acc6513a7d7fc954b4cc1b0b08 (diff) |
Fixed redrawing
Diffstat (limited to 'drawing.ino')
-rw-r--r-- | drawing.ino | 12 |
1 files changed, 2 insertions, 10 deletions
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 */ |