Problem updating clocks on screen - EVE3x43

FTDI/Bridgetek EVE2 & EVE3 & EVE4 SPI TFT Series by Matrix Orbital

Moderator: Mods

Post Reply
kiabrin
LCD?
Posts: 3
Joined: Sun Feb 02, 2025 2:59 am
Contact:

Problem updating clocks on screen - EVE3x43

Post by kiabrin »

Good morning!

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);
}
The methods are defined as:

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

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

Ray
Matrix Orbital
Matrix Orbital
Posts: 745
Joined: Thu Dec 13, 2001 4:00 pm
Location: Earth.... I think..
Contact:

Re: Problem updating clocks on screen - EVE3x43

Post by Ray »

The eve doesn't allow partial updates like that, if you want to update a section of the screen you'll have to send a complete new display list

Post Reply