mirror of
https://github.com/2martens/uni.git
synced 2026-05-06 11:26:25 +02:00
[ES] Improved documentation and code quality
Signed-óff-by: Jim Martens <github@2martens.de>
This commit is contained in:
@ -37,9 +37,7 @@ void setup()
|
|||||||
digitalWrite(dcPin, HIGH);
|
digitalWrite(dcPin, HIGH);
|
||||||
|
|
||||||
// initialize screen buffer
|
// initialize screen buffer
|
||||||
for (int i = 0; i < maxBufferIndex; i++) {
|
resetBuffer();
|
||||||
screenBuffer[i] = 0x0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -60,6 +58,9 @@ void loop()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resets display.
|
||||||
|
*/
|
||||||
void resetDisplay()
|
void resetDisplay()
|
||||||
{
|
{
|
||||||
digitalWrite(rstPin, LOW);
|
digitalWrite(rstPin, LOW);
|
||||||
@ -67,6 +68,11 @@ void resetDisplay()
|
|||||||
digitalWrite(rstPin, HIGH);
|
digitalWrite(rstPin, HIGH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes the screen buffer into the display.
|
||||||
|
*
|
||||||
|
* It does NOT reset the buffer.
|
||||||
|
*/
|
||||||
void flushBuffer()
|
void flushBuffer()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < maxBufferIndex; i++) {
|
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.
|
* Sets the pixel at the given location.
|
||||||
* @param x
|
* @param x
|
||||||
|
|||||||
Reference in New Issue
Block a user