I am having trouble with my 2.9 inch epaper display working mostly in deepsleep and waking up every 12 hours to refresh some data.
It worked flawlessly for some time now with the latest GxEDP2 library. Both partial refresh and full refresh work good on their own, but my latest attempt failed so far: Mostly refreshing partially, and only after x amounts of partials make a full refresh.
In the serial monitor I see that both lines of the library, for making a partial and full refresh are reported. Although only the section of the correct code gets executed (I see that if RebootsPartial is under 60, only the "RebootPartial: " gets printed and over the treshold ("RebootsPartial zurückgesetzt").
Is there anything I forgot to make it work correctly?
void displayRefr() {
if (RebootsPartial < 60) {
RebootsPartial = RebootsPartial + 1;
Serial.print("RebootsPartial: ");
Serial.println(RebootsPartial);
display.setPartialWindow(0, 0, display.width(), display.height());
} else {
RebootsPartial = 0;
display.setFullWindow();
Serial.print("RebootsPartial zurückgesetzt");
display.fillScreen(GxEPD_WHITE);
Serial.print("Display filled?");
}
display.setRotation(3);
display.setTextColor(GxEPD_BLACK);
display.firstPage();
do {
display.fillScreen(GxEPD_WHITE);
//Lines
display.drawLine(0, 16, 296, 16, GxEPD_BLACK); //drawLine(x1, y1, x2, y2, color) Horizontal line
u8g2Fonts.setFont(u8g2_font_fur30_tf);
char timeText[6]; // "HH:MM" + Nullterminierung
sprintf(timeText, "%02d:%02d", RTChour, RTCminute);
// Berechne die Maße des Textes
int16_t x1, y1;
uint16_t w, h;
display.getTextBounds(timeText, 0, 0, &x1, &y1, &w, &h);
// Berechne die mittlere Position des Textes
int x = ((display.width() - w) / 2) - 40; //40hintere zahl ist zur kalibrierung
// u8g2Fonts.setCursor(display.width() / 2, 40);
u8g2Fonts.setCursor(x, 56);
u8g2Fonts.print(timeText);
// u8g2Fonts.print(RTChour);
// u8g2Fonts.print(":");
//u8g2Fonts.print(RTCminute);
} // ende der "do" funktion
while (display.nextPage());
} // end displayRefr funktion