I am developing a display module based on EVE3x43 module.
When I try to redraw digital clock on screen I face strange behaviour: instead of clearing clock area before drawing clock text, screen clears fully with previousely selected color and the vertical strype drawn for whole shcrren heeight instead of rectangular. My code is in C++, but with direct calls to EVE Library:
Code: Select all
void EScreen::onTick() {
gui->eveLock();
eve->DLStart();
drawClock();
eve->DLEnd();
gui->eveUnlock();
}
void EScreen::drawClock() {
eve->clip(clockPos, 0, 80, 50);
eve->clearColorRGB(0x00, 0x20, 0x40);
eve->clear(1, 0, 0);
eve->clip();
time_t t; time(&t);
struct tm *ct = localtime(&t);
char tstr[8];
if((t & 1) != 0)
strftime(tstr, 8, "%H:", ct);
else
strftime(tstr, 8, "%H ", ct);
eve->text(clockPos, 5, 30, 0, tstr);
strftime(tstr, 8, "%M ", ct);
eve->text(clockPos + 42, 5, 30, 0, tstr);
}
Code: Select all
void DLStart() { Send_CMD(CMD_DLSTART); }
void DLEnd() { display(); DLSwap(); updateFIFO(); waitFIFOEmpty(); }
void scissorSize(uint16_t w, uint16_t h) { Send_CMD(SCISSOR_SIZE(w, h)); }
void scissorXY(uint16_t x, uint16_t y) { Send_CMD(SCISSOR_XY(x, y)); }
void clip(uint16_t x, uint16_t y, uint16_t w, uint16_t h) { scissorXY(x, y); scissorSize(w, h); }
void clip() { clip(0, 0, dispWidth(), dispHeight()); }
void text(int16_t x, int16_t y, uint16_t font, uint16_t options, const char* s) {
Cmd_Text(x, y, font, options, s);
}

When I insert the full screen clear code before drawClock(), everething is ok, but my screen obviosely cleared.