Jump to content

STM32F103+SSD1289+ADS7843 screen size changed after GINPUT_NEED_MOUSE enabled


Recommended Posts

Posted

Hello,

I'm trying to make uGFX run on bare metal HY-miniSTM32 board(STM32F103VC) + SSD1289 + ADS7843 with Std Peripheral Library.

The SSD1289 driver for 320x240 display has been revised to use Std Peripheral Library, and it works fine.

Now, I'm working on touchscreen. The ADS7843 driver has been updated to use Std Peripheral Library as well.

However, after GINPUT_NEED_MOUSE set TRUE, the screen size returned by function call gdispGetWidth() and gdispGetHeight becomes 3849x2048.

It seems touchscreen drivers reset the screen size and it doesn't use the screen size set by SSD1289 driver.

Who can please kindly help me on this issue?

 

Thanks,

Josh

 

 

Posted

After tracing down the code, I found the Width and Height in the GDISP->g has been changed by the function call in _gmouseInitDriver()

void gtimerStart(GTimer *pt, GTimerFunction fn, void *param, bool_t periodic, delaytime_t millisec) {
    gfxMutexEnter(&mutex);
    
    // Start our thread if not already going
    if (!hThread) {
        hThread = gfxThreadCreate(waTimerThread, GTIMER_THREAD_WORKAREA_SIZE, GTIMER_THREAD_PRIORITY, GTimerThreadHandler, 0);
        if (hThread) {gfxThreadClose(hThread);}        // We never really need the handle again
    }

 

Especially after gfxThreadCreate. Somehow, the GDISP->g.Width got changed to the value of GTIMER_THREAD_WORKAREA_SIZE which is 2048.

 

Posted

This is definitely most likely an issue with stack overflows. This piece of code is extremely well tested as almost everybody uses it.

Along with what @inmarket said, keep in mind that 2k stack is not a lot for when you're doing graphics. That's surely enough to draw a few rectangles and so on but you'll quickly run out of memory when you start rendering fonts & images and when starting to dick around with the window manager. Usually you'd start way higher and then minimize the stack size until you have something that works in all conditions.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...