Jump to content

Smd

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Smd

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

×
×
  • Create New...