diff --git a/src/Inkplate.cpp b/src/Inkplate.cpp index fffbc64..e42390c 100644 --- a/src/Inkplate.cpp +++ b/src/Inkplate.cpp @@ -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(); } diff --git a/src/include/System.cpp b/src/include/System.cpp index 65d4c0c..95582de 100644 --- a/src/include/System.cpp +++ b/src/include/System.cpp @@ -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; diff --git a/test/partial/partial.ino b/test/partial/partial.ino new file mode 100644 index 0000000..09ca3b7 --- /dev/null +++ b/test/partial/partial.ino @@ -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(); +}