From 76c63a504da45ec8ca5f34691833974952566f1b Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Thu, 25 Jun 2015 11:35:59 +0200 Subject: [PATCH] [ES] Improved documentation and code quality MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-óff-by: Jim Martens --- es/blatt5/uebung5-1/uebung5-1.ino | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/es/blatt5/uebung5-1/uebung5-1.ino b/es/blatt5/uebung5-1/uebung5-1.ino index 2346408..6386d00 100644 --- a/es/blatt5/uebung5-1/uebung5-1.ino +++ b/es/blatt5/uebung5-1/uebung5-1.ino @@ -37,9 +37,7 @@ void setup() digitalWrite(dcPin, HIGH); // initialize screen buffer - for (int i = 0; i < maxBufferIndex; i++) { - screenBuffer[i] = 0x0; - } + resetBuffer(); } /** @@ -60,6 +58,9 @@ void loop() } +/** + * Resets display. + */ void resetDisplay() { digitalWrite(rstPin, LOW); @@ -67,6 +68,11 @@ void resetDisplay() digitalWrite(rstPin, HIGH); } +/** + * Writes the screen buffer into the display. + * + * It does NOT reset the buffer. + */ void flushBuffer() { for (int i = 0; i < maxBufferIndex; i++) { @@ -74,6 +80,18 @@ void flushBuffer() } } +/** + * Resets the buffer. + * + * Writes 0 in all fields. + */ +void resetBuffer() +{ + for (int i = 0; i < maxBufferIndex; i++) { + screenBuffer[i] = 0x0; + } +} + /** * Sets the pixel at the given location. * @param x