Jump to content

[TODO] GWIN Console scroll strange behavior


Smd

Recommended Posts

Hello

I have one console and one slider.

In the main loop, a character is inserted in console. GT1 timer update the slider current position.

With #define GDISP_NEED_SCROLL TRUE defined in gfxconf.h , from time to time I can see a missing character on console, right after console scroll.

If I move slider position fast, I see more lines with missing first character, and sometime touchscreen stop responding, until hardware restart of the board.

68ud.gif


#include "gfx.h"

GTimer GT1;
static GHandle ghConsole;
static GHandle ghSlider1;

uint8_t i=0;

void callback1(void* arg) {
(void)arg;
gwinSliderSetPosition(ghSlider1,i);
}


static void createWidgets(void) {
GWidgetInit wi;

// Apply some default values for GWIN
wi.customDraw = 0; wi.customParam = 0; wi.customStyle = 0; wi.g.show = TRUE;

// Create the console
wi.g.width = 50; wi.g.height = 200; wi.g.y = 20; wi.g.x = 20;
ghConsole = gwinConsoleCreate(NULL, &wi.g);

// Set the console colors
gwinSetColor(ghConsole, Yellow);
gwinSetBgColor(ghConsole, Black);

// create Slider1
wi.g.width = 50; wi.g.height = 200; wi.g.y = 20; wi.g.x = 100; wi.text = "";
ghSlider1 = gwinSliderCreate(NULL, &wi);
gwinSliderSetRange(ghSlider1,0,255);

// Clear the console
gwinClear(ghConsole);
}

int main(void) {

// Initialize the uGFX and the underlying system
gfxInit();

// Set the widget defaults
gwinSetDefaultFont(gdispOpenFont("UI2"));
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
gdispClear(White);

// Attach the mouse input
gwinAttachMouse(0);

// Create the widget
createWidgets();

// initialize the timer
gtimerInit(&GT1);

//continious mode - callback1() called without any argument every 250ms
gtimerStart(&GT1, callback1, NULL, TRUE, 100);

while (1) {
gwinPutChar(ghConsole,'0'+i%10);
gfxSleepMilliseconds(100);
i++;
}

return 0;
}

Does anyone can help me to understand what's wrong ?

Kind Regards,

Smd

Link to comment
Share on other sites

I have an idea on what might be going on.

Can you please define GDISP_NEED_CLIP as FALSE in your gfxconf.h file and see if the symptoms continue.

I suspect it is a multi-threading issue with the way that gwin uses the clipping calls.

If the symptoms dissappear i know what needs to be done to fix it properly.

Link to comment
Share on other sites

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...