Hi ugfx forum,
I am curious about ugfx and for two weeks now tried to port it to one str710 based board that has ssd1963 with xpt2046 chips and see if it will work. using Keil v5 compiler, i setup my project to include ugfx trees and config files as prescribed, all is fine, everything compile (though lots warning occurs). fyi, first i tried to compile in Arm mode, then tried Thumb mode with interwork. The result at first is weird. If i compile in arm mode, no interwork, all my files compiled through and when the apps execute, I cannot see anything at all. (except white screen) no button etc.
So next I tried to compile with Thumb mode, all files, no interwork and voila! I see it work. But the execution is awfully slow. SO i decided to interwork between arm and thumb. for ugfx I compiled with thumb mode and my apps with arm. so the result is interworked ugfx ( at least, i assume this is). execution is fast and touchscreen worked fine along with driver for xpt2046. I got through with Callibrating screen and see buttons according to my design layout. This is where my real problem comes in and had me scratching my head for a couple of days now.
After getting through the calibrating screen, which I believe validates my driver is all working ok...There is no mouse event happened. I cannot seem to see where the fault is. I do not want to bored anybody with redundancy...so here goes the code.
GFXCONF: just some tweak, the rest is standard ugfx studio generated.
#define GFX_USE_OS_RAW32 TRUE
#define GFX_COMPILER GFX_COMPILER_KEIL
#define GFX_OS_HEAP_SIZE 40260 // Somehow dynamic memory is just not running at all. so for now I need to enable static
#define GINPUT_TOUCH_STARTRAW FALSE
//#define GDISP_INCLUDE_FONT_UI2 TRUE
//#define GWIN_NEED_CONSOLE TRUE
#define GFX_EMULATE_MALLOC TRUE
#define GDISP_SSD1963_NO_INIT TRUE // using init for SSD1963 does not work in both arm and thumb mode. have to init manually
#define GINPUT_MOUSE_POLL_PERIOD 25
systicks is generated by TIMER0 Compare function of str710 fired every 1ms, along with my short main. basically it runs to while loop standard and gfxsleep every 100ms.
int main (void) {
/*
UWORD8 i = 0;
WORD32 n = 0;
// UWORD8 msby, lsby,msbx,lsbx;
*/
BOOL exitThread = FALSE;
GSourceHandle gs;
GEventMouse *pem;
GMouse * m;
GMouseVMT * vmt;
target_init();
app_init();
gfxInit();
gdispClear(White);
// exitThread = TRUE;
gdispSetBacklight(0xF0);
gdispSetContrast(40);
guiCreate();
geventListenerInit(&gl);
gs = ginputGetMouse(GMOUSE_ALL_INSTANCES);
geventAttachSource(&gl, gs,GLISTEN_TOUCHDOWNMOVES);
gwinAttachListener(&gl);
gfxThreadCreate(NULL, 2042, NORMAL_PRIORITY, threadfunction, (void*)&exitThread); // somehow I managed another thread blinking led as run status. It worked!!
while(1)
{
gfxSleepMilliseconds(100);
// Do nothing
}