emWin + embOS Wind32 Simulation OS_Delay issue

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

  • emWin + embOS Wind32 Simulation OS_Delay issue

    Hi,

    I've constructed a Win32 project combining embOS-SIM and emWin-SIM (from Keil). Much more practical development environment than trying to do everything on hardware. I will eventually port from embOS to Keil RTE (for license reasons).

    Problem is I create a new child window yet it does not show if my while(1) loop uses OS_Delay() yet works if I use GUI_Delay(). Do I need to make sure to use GUI_Delay in all GUI tasks or should OS_Delay work? OS_Delay works for the example in the emWin manual (Hello World painted on back canvas, 3 threads running).


    void MainTask(void) {
    COMPLEXDIAL myDial = COMPLEXDIAL_Default;

    myDial.hParent = WM_HBKWIN;
    COMPLEXDIAL_Create(&myDial);

    while (1) {
    //OS_Delay(100); //<---- does not work
    GUI_Delay(100); //<---- works
    }
    }

    Thanks
    Mark
  • Hi Mark,

    Interesting project.

    Of course you need to call a GUI_Delay(). A GUI_Delay() does a lot more than just waiting for specific time. It updates all invalid windows, handles touch input, etc. But it doesn't do anything OS related.

    On an embedded system you would have a GUI_X_embOS.c which defines a set functions. These functions call OS related functions.

    For example:

    When calling a GUI_Delay() at some point a GUI_X_Delay() will be called and this function calls an OS_Delay().

    In the simulation this is done the same way, just calling Windows function instead of embOS functions.

    You can try the following, rename the GUI_X_embOS.c to GUI_X_Sim.c and link it into your project. The other thing you can try is to use the GUI_X_Sim.c and fill the functions with embOS functions.

    But I can't guarantee that this will work, but you can give it a try.

    Regards,
    Sven
    Files
    • GUI_X.zip

      (3.09 kB, downloaded 374 times, last: )
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Thanks Sven. I'm stripping complexity out of project. Problem is I don't get fault to replicate each time so I need to dig more.


    Q: do you have an example VS Template for emWin + embOS SIM? Something a bit more than the Hello World of the emWin manual, maybe? Without the libraries etc as I have these. This would be a useful reference, make sure I don't have config or VS setup issues.

    Mark

    The post was edited 1 time, last by the.mark.robertson ().

  • Hi Mark,

    we don't have a sample project for VS using emWin AND embOS.
    We have samples for emWin: segger.com/emwin-samples.html

    If the hello world application is running properly you just need to exchange the hello world sample with one of the samples above (the link).

    Regards,
    Sven
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Thanks Sven.

    I have the emWin and embOS-SIM samples but not a combination of both in a VS Solution. That would have been useful, that's all. Maybe this would be a nice download for you guys to have? Minus the libraries, of course. For me, developing under Studio and having conditional compiles for the hardware layers is much faster, much more efficient.

    That said, I now seem to have a stable embOS + emWin + Visual Studio SIM template project now. Hardkey coding added to SIM environment.

    Thanks for your rapid responses to my forum questions.

    Regards,
    Mark