11-04-2013 04:24 PM
How can I know when an event has occured. Like a boolean or event status that can be compared so that only if it is true I can execute another set of code ?
11-04-2013 04:26 PM
This is the entire purpose of the event structure. You register your event to it and it will only run certain code when a certain event happens.
11-04-2013 04:29 PM
in that case, I have an event that tells me if an image is available from the camera. and only when an event occurs, that is if an image is available I get to save it. But when I do 2x2 scan and have to capture 3 images for each pixel, I see that it misses certain images. This doesnt happen in any particular order.
Is it nevessary to add unregister user events and destroy event after the event structure for every single pixel ?
11-05-2013 04:49 PM
Are you actually creating a user event for when the image is available, or are you programatically updating an LED indicator when an image is available and then using that value change to try and trigger and event change? Also, can you please explain a bit more what you mean by a 2x2 scan and capturing three images for each pixel? I'm not entirely sure what your application is doing.
Unregistering events just means that the event structure associated with that event will no longer trigger when the event occurs. Unregistering is not necessary for normal operation.
11-06-2013 03:47 AM - edited 11-06-2013 03:47 AM
If you are passing a reference to an image via event and the image itself has a limited lifetime then a race condition (Events are asynchronous) can cause your software to work on image references which have (since the event was fired) since become invalid.