Jump to content
jcc147

STM32F103+SSD1289+ADS7843 screen size changed after GINPUT_NEED_MOUSE enabled

Recommended Posts

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

 

 

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...