-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example using delay or yield in class instantiated in task #17
Comments
Hi, This is not something I have ever thought of doing. Off the top of my head, I would probably pass the delay function through as a param, rather than the task, would this work for you? |
Hi, What would passing the function look like? It should still set ps. By the way, thanks for the library! |
Hi, It would look something like this:
I havnt tried the code, but it is around there somewhere. |
Thanks, I will try it out! |
I tried another approach which would not require passing a function or object: I added the static function
to Scheduler. My thinking was that I could then call it the Non-Task object (e.g. PrintManager) as However, this gives a niece big crash as soon as current->delay calls the underlying Do you have any idea why? I am afraid that I do not understand the mechanics deeply enough to see why this fails. |
It entirely depends on how this is done. It would be very difficult to say without being able to map its exact flow. |
I'd also like to call delay and yield without passing those functions all the way down. I just tried what @thijse proposes and it seems to work just fine.
did you also happen to define yield as a class method?, if you did, make sure to also change |
It would be great if you can add an example on how to use a non blocking delay in a other class than the Task itself.
I am now doing it like the example below (based on the Simple.ino example), but it requires changing the scheduler to make delay & yield public
Thanks!
The text was updated successfully, but these errors were encountered: