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

@ -160,7 +160,7 @@ void Inkplate::begin(void)
memset(_partial, 0, 60000);
memset(_pBuffer, 0, 120000);
memset(D_memory4Bit, 255, 240000);
_beginDone = 1;
}
@ -495,9 +495,10 @@ void Inkplate::einkOff()
delay(6);
PWRUP_CLEAR;
WAKEUP_CLEAR;
unsigned long timer = millis();
do {
do
{
delay(1);
} while ((readPowerGood() != 0) && (millis() - timer) < 250);
@ -531,26 +532,28 @@ 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)
if ((millis() - timer) >= 250)
{
WAKEUP_CLEAR;
VCOM_CLEAR;
PWRUP_CLEAR;
return;
VCOM_CLEAR;
PWRUP_CLEAR;
return;
}
OE_SET;
setPanelState(1);
}
uint8_t Inkplate::readPowerGood() {
uint8_t Inkplate::readPowerGood()
{
Wire.beginTransmission(0x48);
Wire.write(0x0F);
Wire.endTransmission();
Wire.requestFrom(0x48, 1);
return Wire.read();
}

View File

@ -32,7 +32,7 @@ uint8_t System::getPanelState()
int8_t System::readTemperature()
{
int8_t temp;
if(getPanelState() == 0)
if (getPanelState() == 0)
{
WAKEUP_SET;
PWRUP_SET;
@ -50,7 +50,7 @@ int8_t System::readTemperature()
Wire.requestFrom(0x48, 1);
temp = Wire.read();
if(getPanelState() == 0)
if (getPanelState() == 0)
{
PWRUP_CLEAR;
WAKEUP_CLEAR;

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();
}