Posts by anuj.tanksali

    Hello,

    I was able to display the bmp and rotate it through memdev. I created the memdev's required in a different function, performed the rotate and kept the memdev ready. I displayed the memdev in WM_PAINT by GUI_MEMDEV_WriteAt function

    GUI_SetBkColor(GUI_GRAY)
    GUI_Clear();
    GUI_MEMDEV_WriteAt(hDst,DIAL_SCREEN_HOME_ARC_CENTER_POS_X-(236/2), DIAL_SCREEN_HOME_ARC_CENTER_POS_Y-(236/2));
    drawArc();

    This is working but the screen loading performance is not improved much. My main intention is to improve the dialog loading performance so used memdev for rotating the bmp instead of knob widget. I thought this would improve the dialog loading but not much improvement.

    if I comment out the code for drawing and rotating the bmp the dialog loads faster.
    How can I improve the memdev drawing so that it loads faster?

    Thanks
    Regards,
    Anuj

    Hello,

    I tried out as per the link given but facing some issues. I have made a function which does the task of writing to memory device.

    My code is as below,

    static GUI_MEMDEV_Handle hDst = 0;
    static GUI_MEMDEV_Handle hSrc = 0;
    int xSize = 235;
    int ySize = 235;

    hSrc = GUI_MEMDEV_CreateFixed32(0, 0, xSize, ySize);

    GUI_MEMDEV_Select(hSrc);

    GUI_DrawBitmap(bmdial , 0, 0)

    GUI_MEMDEV_Select(0);

    hDst = GUI_MEMDEV_CreateFixed32(0, 0, 500, 500);
    GUI_MEMDEV_Select(hDst);
    GUI_SetBkColor(GUI_TRANSPARENT);
    GUI_Clear();
    GUI_MEMDEV_Select(0);

    GUI_MEMDEV_RotateHQHR(hSrc, hDst, 100, 400, 45 * 1000, 1 * 1000);

    GUI_MEMDEV_WriteAt(hDst, DIAL_SCREEN_HOME_ARC_CENTER_POS_X-(235/2), DIAL_SCREEN_HOME_ARC_CENTER_POS_Y-(235/2));

    GUI_MEMDEV_Delete(hSrc);
    GUI_MEMDEV_Delete(hDst);

    the above function is called in my loop which is called every 25msec.

    I also have a onpaint which draws other stuff as below,

    GUI_SetBkColor(GUI_GRAY)
    GUI_Clear()
    drawArc();

    other point is am testing this on my hardware with iMXRT1064 controller.
    If I call the above function in my super loop on 25msec then it does not draw.
    I called the function in onpaint after GUI_clear() above as below

    GUI_SetBkColor(GUI_GRAY)
    GUI_Clear()
    drawDial();
    drawArc();

    then it draws when I single step through the code. after drawing the bmp, when GUI_exec is called the whole screen becomes blank.

    Please let me know what am missing?

    Thanks
    Regards,
    Anuj

    Hello,

    Thanks,
    I checked out the above link and will try it.
    There is a onpaint function for the dialog so the above code should go in onpaint or in my normal superloop while(1)? as we have to rotate the bmp at runtime depending on angle.

    If there is anything else we can try to achieve good performance with 2 buffers and without WM_CF_MEMDEV set please let me know as using 2 buffers is still slow. Am using iMXRT1064 controller. is there anything on the controller side which can be done other than DMA?

    Thanks
    Regards,
    Anuj

    Hello,

    Thanks for the reply.

    I have already used the LCD_SetDevFunc() to set the custom copy buffer function.
    I will check the DMA option.

    Will using 3 buffers cause an improvement in speed regarding dialog loading?

    As mentioned above the knob widget seems to slow down dialog load quite a bit.
    Can we achieve the knob functionality with some other methods like memdev for drawing the bmp and memdev_rotate for rotating the bmp.
    if there is any sample project please share it.

    Thanks
    Regards,
    Anuj

    Hello,

    I have a number of dialog windows for screens and navigate from one dialog to another. I had used RGB565 with multibuffering and Memdev enabled using WM_SetCreateFlags(WM_CF_MEMDEV) but observed dialog loading is slow. I call GUI_exec() continuously in my super loop while(1) to update the dialogs.

    I performed the following configurations below to check the dialog loading in each case.

    With WM_SetCreateFlags(WM_CF_MEMDEV) and #define GUI_BUFFERS 2
    - Navigation between dialogs is slow.

    Without WM_SetCreateFlags(WM_CF_MEMDEV) and #define GUI_BUFFERS 2
    - Navigation between dialogs is slow.

    Without WM_SetCreateFlags(WM_CF_MEMDEV) and #define GUI_BUFFERS 1
    - Navigation between dialogs is fast but all dialogs flicker a lot while loading

    With WM_SetCreateFlags(WM_CF_MEMDEV) and #define GUI_BUFFERS 1
    - Navigation between dialogs is fast when compared to first 2 options but still needs to improve

    Am using the last option above currently as it is fast when compared to other options.

    With some of the dialogs knob widget is present. if knob widget is removed then it certainly improves the specific dialog load speed
    I tried to use memdev for drawning bmp and rotate it using GUI_MEMDEV_Rotate to achieve similar functionality as knob but nothing was drawn on the LCD.
    Do you have any sample code which replicates the knob functionality but is fast when it loads. if yes then please share it.

    What can be done further to improve the load speed of the dialogs? and which is the best option to use from above options?

    Thanks
    Regards,

    Anuj Tanksali

    Hi ,

    Thanks for your reply.
    I realized this earlier and had already corrected the code but still same issue.

    Please see latest code below,
    touchState is declared as static

    uint16_t touchX = 0;
    uint16_t touchY = 0;
    uint8_t pressed = FALSE;
    static uint8_t prevState = FALSE;

    // Call the function to get the raw values of x,y
    pressed = Touch_getPositionRaw(&touchX, &touchY);

    if(pressed == TRUE){
    // Set the parameters to send to emwin.
    touchState.Pressed = TRUE;

    // Set the values;
    touchState.x = touchX;
    touchState.y = touchY;
    // Store the pressed state for emwin to process.
    ProcessTouch_storePidState(&touchState);
    prevState = pressed;
    }
    else if(prevState != pressed){
    prevState = pressed;
    touchState.Pressed = FALSE;
    // Store the unpressed state for emwin to process.
    ProcessTouch_storePidState(&touchState);
    }

    I have used 9 point calibration and used calcoefficients as below
    int touchRefValX[TOUCH_MAX_CALIBRATION_POINTS] = {40,400,760,40,400,760,40,400,760};
    int touchRefValY[TOUCH_MAX_CALIBRATION_POINTS] = {24,24,24,240,240,240,456,456,456};

    int touchSampleValX[TOUCH_MAX_CALIBRATION_POINTS] = {2573,1963,1550,2542,1976,1547,2547,1968,1544};
    int touchSampleValY[TOUCH_MAX_CALIBRATION_POINTS] = {2319,2300,2300,1982,1971,1968,1787,1780,1776};

    My init code for touch calibration is as below

    // Set the calibration coefficients.
    GUI_TOUCH_CalcCoefficients(9, &touchRefValX[0], &touchRefValY[0], &touchSampleValX[0], &touchSampleValY[0], 800, 480);

    // Enable use of above calibration coefficients.
    GUI_TOUCH_EnableCalibration(TRUE);


    My screen is 800x480 pixels and my ADC range is just 1000 counts from 1500-2500 on x and y direction.
    Will this be any issue?

    Thanks
    Regards,
    Anuj

    Hello,
    Am using iMXRT1064 with Emwin library and 7" resistive touch screen. I am using a custom ADC driver to read x and y values.

    // points p0,p1,p2 x and y pixels
    int touchRefValX[3] = {40,760,400};

    int touchRefValY[3] = {24,240,456};
    // ADC x and y values at above points
    int touchSampleValX[3] = {2552,1528,1954};

    int touchSampleValY[3] = {2295,1960,1803};

    the range of ADC values for x and y are always in around 1400 counts to 2500 counts.for 12 bit range should be 0-4096.
    // init
    GUI_TOUCH_CalcCoefficients(3, &touchRefValX[0], &touchRefValY[0], &touchSampleValX[0], &touchSampleValY[0], 800, 480);
    GUI_TOUCH_EnableCalibration(1);

    //read touch
    pressed = get_adc(&touchX,&touchY)
    if(pressed == TRUE){
    touchState.Pressed = TRUE;
    touchState.x = touchX;
    touchState.y = touchY;
    GUI_TOUCH_StoreStateEx(&touchState);
    prevState = pressed;
    }
    else if(prevState != pressed){
    touchState.x = -1;
    touchState.y = -1;
    touchState.Pressed = FALSE;
    prevState = pressed;
    GUI_TOUCH_StoreStateEx(&touchState);
    }
    I get the pressed and un-pressed but actual touch it does not work as expected.
    i was able to debug and found that i don't get the release events always. When i get the release event then it works as expected.
    I mostly get the WM_NOTIFICATION_CLICKED and WM_NOTIFICATION_MOVED_OUT events but rarely get the WM_NOTIFICATION_RELEASED event.

    What am i doing wrong? Any sample code with similar configuration would be helpful.

    Thanks & Regards
    Anuj

    Hi,

    I am using a simulator for my application and porting the code to my Hardware on iMXRT1064.
    I see a difference in colors on my PC simulation application when compared to colors on the LCD with hardware.
    color mode is RGB 565 on both simulation and my hardware.
    Am using emwin version 5.50 on hardware.

    The colors on the hardware look dull compared to the simulation on PC.
    Does emwin have any setting to improve the colors on the hardware.

    Thanks
    Regards,

    Anuj

    Hello,

    How to i compare windows fonts sizes with fonts sizes generated from font converter.

    On windows for e.g. word application if i select century gothic 12. will it be same as selecting century gothic 12 pixel on font convertor. I am not sure as the font sizes appear different. So how do i select the correct font size in font convertor for any windows font size in Microsoft Word application.

    Thanks
    Regards,
    Anuj

    Hello,

    Thank you for your reply.

    But as the font is different in any case should it not generate different name file. suppose i have used one bold pt font and one regular font in my project with different pts. if the file names for both are same suppose then when i will generate the 2nd font as it has same name it will replace the first font file in my project which is not correct. If one does not keep a track then it is more likely that the font applied for widgets will be changed unknowingly.

    Thanks
    Regards,

    Anuj

    Hello,

    I am using Font converter ver 5.48d. I generate the fonts by selecting using pt option instead of pixels.

    I have observed that when i select Century Gothic Regular font 9pt and 10pt, for both the file name generated is the same i.e. Century Gothic17.c.

    is this expected? . Visually the font seem different.
    For bold option and different pt size then also file generated is Century Gothic17.c.

    Thanks
    Regards,

    Anuj

    Hello,

    I used the latest version 6.14 simulation and my same code worked fine without any issue.
    I am currently using 5.48 version.

    I observed the emwin memory usage by using GUI_ALLOC_GetMaxUsedBytes and in 6.14 version the usage bytes is almost double than in case of 5.48 version.

    Version 5.48 and 6.10 give me the same application crash issue with GUI_MEMDEV_BlendWinBk but issue is not present for 6.14 version.
    Is this an issue with 5.48 version not allocating enough memory?

    Thanks
    Regards,

    Anuj

    Hello,

    Thanks for your reply.

    I cannot share the code but i debugged the issue and found that when i reduce the widgets from the widget resource table then the issue is not observed

    const GUI_WIDGET_CREATE_INFO ScreenWidgetTable[] = { \
    \
    { WINDOW_CreateIndirect, NULL,GUI_ID_WINDOW_0,0,0,0,0,0, 0, 0 },
    { BUTTON_CreateIndirect, "CANCEL", GUI_ID_BUTTON_CANCEL,0,0,0,0,0, 0, 0 },
    { BUTTON_CreateIndirect, "CONFIRM", GUI_ID_BUTTON_CONFIRM,0,0,0,0,0, 0, 0 },
    //{ TEXT_CreateIndirect,"",GUI_ID_TEXT_VARIABLE_TITLE, 0, 0, 0, 0, 0, 0, 0 },
    //{ TEXT_CreateIndirect,NULL,GUI_ID_TEXT_OPTION1,0,0,0,0,0, 0, 0 },
    //{ TEXT_CreateIndirect,NULL,GUI_ID_TEXT_OPTION2,0,0,0,0,0, 0, 0 },
    //{ EDIT_CreateIndirect,NULL,GUI_ID_EDIT_VAL,0,0,0,0,0, 0, 0 },
    //{ BUTTON_CreateIndirect, NULL,GUI_ID_BUTTON_DOWN,0,0,0,0,0, 0, 0 },
    //{ BUTTON_CreateIndirect, NULL,GUI_ID_BUTTON_UP,0,0,0,0,0, 0, 0 },

    please ignore the x,y, and size parameters in above table as i have purposely set them to zero to make the table readable to you.


    when i uncomment the 4th line i,e, { TEXT_CreateIndirect,"",GUI_ID_TEXT_VARIABLE_TITLE, 0, 0, 0, 0, 0, 0, 0 }, or any further line
    then the issue with the crash is observed. i have tried uncommenting the button widget entries below and comment the text entry but still same issue.

    it seems if the widgets are increased the crash issue is observed.

    please let me know what could be the issue?

    Thanks
    Regards,
    Anuj

    Hello,

    I am using a iconview widget and it consists of 6 icons 3 on top row and 3 on bottom row. The width of iconview is around 550 pixels so i have to add spacing in between to align the icons to fit 3 on top and 3 on bottom to 550 pixels.

    When i press and release the area between the icons i receive the release event which i do not want.
    The iconview should give the event only if the icon area is clicked. how can this be achieved.

    Thanks
    Regards,

    Anuj

    Hello,

    I am facing a problem related to GUI_MEMDEV_BlendWinBk .

    I display 6-7 windows one after another in my application. Please see my flow below,

    1) Display Window 1 - after some delay delete window 1 and display window 2
    2) Display Window 2 - on button click delete window 2 and display window 3
    3) Display Window 3 - on button click delete window 3 and display window 2
    4) Display Window 2 - after some delay delete Window 2 and display window 4
    5) Display Window 4 - on button click delete Window 4 and display window 5
    6) Display Window 5 - on button click delete Window 5 and display window 6
    7) Display Window 6 - on button click display window 7 and call GUI_MEMDEV_BlendWinBk on WM init for window 7 to blend background window.

    I get an exception at GUI_MEMDEV_BlendWinBk call. Attached is the error.

    the weird part is when points 2, 3, 4 are skipped the GUI_MEMDEV_BlendWinBk does not give exception and result is as expected.
    i.e. if after window 1 i directly show window 4 and proceed further as per points then the exception is not shown.
    when the exception is thrown the window 7 handle is 4 and when exception does not come the window 7 handle is 48.

    I think i have allocated sufficient memory to emwin by by #define GUI_NUMBYTES 0x1000000.
    Not sure what is causing the issue here.
    Do i have to clear any memory other than WM_DeleteWindow?


    unfortunately i cannot share the code.
    Please point me to a direction from where i can proceed.

    Thanks
    Regards

    Anuj