fixed code format on last commit + added partial test.

This commit is contained in:
nitko12 2020-10-12 10:20:53 +02:00
parent fc268c7655
commit ef1a7f79b6
3 changed files with 40 additions and 12 deletions

View File

@ -497,7 +497,8 @@ void Inkplate::einkOff()
WAKEUP_CLEAR;
unsigned long timer = millis();
do {
do
{
delay(1);
} while ((readPowerGood() != 0) && (millis() - timer) < 250);
@ -531,7 +532,8 @@ void Inkplate::einkOn()
VCOM_SET;
unsigned long timer = millis();
do {
do
{
delay(1);
} while ((readPowerGood() != PWR_GOOD_OK) && (millis() - timer) < 250);
if ((millis() - timer) >= 250)
@ -546,7 +548,8 @@ void Inkplate::einkOn()
setPanelState(1);
}
uint8_t Inkplate::readPowerGood() {
uint8_t Inkplate::readPowerGood()
{
Wire.beginTransmission(0x48);
Wire.write(0x0F);
Wire.endTransmission();

25
test/partial/partial.ino Normal file
View File

@ -0,0 +1,25 @@
#include "Inkplate.h"
Inkplate display(INKPLATE_1BIT);
void setup()
{
Serial.begin(115200);
display.begin();
}
void loop()
{
for (int j = 0; j < 50; ++j)
{
for (int i = 0; i < 100; ++i)
display.drawFastVLine(i * 5 + j * 3, 0, 600, BLACK);
for (int i = 0; i < 100; ++i)
display.drawFastHLine(j * 3, i * 5, 800, BLACK);
display.partialUpdate();
display.clearDisplay();
}
display.clean();
display.display();
}