Jump to content
trunet

Last commit made geventEventWait returning immediately

Recommended Posts

My code has:

pe = geventEventWait(&gl, MS2ST(500));

on the infinite loop inside a thread.

after last commit it's not returning after 500ms but immediately.

Share this post


Link to post
Share on other sites

If you want after 500ms the 2nd parameter should 500 not MS2ST(500) as geventEventWait takes milliseconds as the 2nd parameter.

Try that change first and let us know if that works.

I know there were bugs around that area in the old code. If the new code does not work after the above change let us know and I will do some tests.

Share this post


Link to post
Share on other sites
If you want after 500ms the 2nd parameter should 500 not MS2ST(500) as geventEventWait takes milliseconds as the 2nd parameter.

I don't think geventEventWait should take milliseconds as second parameter. A better approach would be to use chibios convention and use this MS2ST among others helper functions to wait certain things.

BTW, I made the suggested test and it keeps returning immediately:

pe = geventEventWait(&gl, 500);

Share this post


Link to post
Share on other sites

All timing functions in ugfx use real time milliseconds or microseconds. This is because ugfx is designed to be operating system neutral. MS2ST is a chibios specific call.

Some operating systems don't even have the concept of a "tick". Even chibios V3 is "tickless" with ticks only being maintained as a optional scheduler quantum and for V2 compatibility.

I will run some tests over the next few days to see why geventEventWait might be returning early.

Share this post


Link to post
Share on other sites
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...