A couple of problems with LISTWHEEL & static const char*

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • A couple of problems with LISTWHEEL & static const char*

    1. I'm using a LISTWHEEL widget, I've set the snap position(LISTWHEEL_SetSnapPosition), LISTWHEEL_MoveToPos, & LISTWHEEL_SetSel. Everything works fine in my simulation. When I try to use the on my demo board, I can see LISTWHEEL getting created, data getting attached to it but I couldn't get the desired output. Basically I tried to create 3 LISTWHEELs, & tried to updates each of them with day, month & year. I debugged by marking a breakpoint, it passes through it, but never gets updated.

    2. When I use static const char*, if the two strings in the array are similar, it's causing some problem. As I've mentioned in the below example, foo1 gives me weird output, but foo2 gives me required output. Whys is it so?

    Source Code

    1. static const char* foo1[] = { "String 1", "String 2", "String 1", "String 3", NULL };
    2. static const char* foo2[] = { "String 1", "String 2", "String1", "String 3", NULL }; // I've removed the space b/n String & 1 in the third subscript

    Please help me with this. Thank you.

    -- Rahul
  • Dear Adrain,

    1. I'm trying to access the variables passed as parameters to set the current Day, Month, Year for the respective LISTWHEELS. Even if I'm hard coding the values in place of parameters, the wheel is not getting updated.
    (Please refer to the files attached.)

    2. I find this happening when ever given two strings are same in an array. Again I'm declaring the array of these strings in one file & accessing it in another file by passing it as a structure parameter. I've declared array as I've shown in the earlier post. I'm displaying this on a Frame using TEXT_CreateEx.

    Thanks for your replies Adrain.

    The post was edited 3 times, last by rahul ().

  • Was this problem reroduced or solved in any release?

    I am experiencing the same problem but slightly different :D
    I want to create a listwheel for selection of a IP address. For this I made one const text that contains all the possible elements of one Byte of the IP address. Then I created four listwheel and attached to all of them the same const text by using the function LISTWHEEL_SetText. By doing this the last wheel, the fourth, will not get all of the text elements attached! All wheels show the Elements from 0 to 254 but the last one shows only the element from 0 to 252.

    The second problem is that moving the position of the wheels does not work for all of them. I use the function LISTWHEEL_MoveToPos to moe to a item of the list wheel. But this works only for the wheels one and two. If I do this for the third wheel it does not move a bit. If do the same for the fourth wheel I get a hard fault.

    I this some kind of memory issue? Is the const text copied somewhere?
  • Hello,

    Unfortunately I was not able to use the files contained in the archive Demo.zip. There are missing header files and therefor undefined identifiers.

    If there is a problem with the LISTWHEEL widget, please provide me with a small sample application I can compile and debug in the emWin simulation environment. Please feel free to use the emWin simulation trial software which can be downloaded from segger.com.

    A part of the problem you describe might be caused by the lack of memory. Possibly there is not enough memory to add the last to elements to the last LISTWHEEL widget, so this action is not performed. The same reason might cause a LISTWHEEL not to move, but I am not quite sure about this. Maybe you give it a try and increase the size of the emWin memory.

    Best regards,
  • Meanwhile I did some more testing on the Listwheel.
    Previously I assumed that maybe the lack of memory could cause the problems, but I have checked the GUI-Heap fill level and came to the conclusion that this can not be the reason. Creating one Listwheel with 256 Textentries creates in my configuration a heap chunk of ~7KBytes. After creatign four of the listwheels, I still have ~12kBytes of free GUI heap memory. So there is plenty of space left to put some additional entries into a listwheel.

    I also checked the number of text entries that can be added to the listwheels without getting the strange behavior. The entries 0-252 work perfect, adding one more entry causes the strange behavior on all of the listwheels shown in this window.

    I will try to make a demo project, but I am not using the simulation yet and there is no microsoft compiler in reach.