-
Notifications
You must be signed in to change notification settings - Fork 97
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
Allow on_state() functions #10
Comments
Created pull request #11 solving this and other issues. |
I am using this version of the library but I am now getting errors: collect2.exe*:error: ld returned 1 exit status Is there an include statement missing? |
@DeeJee You'll need to post some code. That error can be for multiple reasons (e.g. missing namespace). Try to reproduce the error with as small a program as possible and post it here. Also worth making sure that by "this version" you mean the code in the pull request this issue references? |
I did what you suggested and made a tiny program with only the state machine code in it. It now compiles fine. That leaves me with a quest to find the code that caused the problem. The main version of the state machine works fine with my code but the code from the pull request does not. I think I made a mistake in my own code that I got away with.... until now. Anyway, thank you for your tip. I should have thought about that myself :o |
I currently have the state machine in use in my project. It is working fine and I an using all three functions. Thank you for creating this library. |
@DeeJee Are you referring to |
I am referring to the three functions that are passed into the State objects. I believe they are called on_enter, on_state and on_exit. |
Allow states to have a
on_state()
function that will run while in that state.Main program loop will need a call to
run_machine()
to resolve thanon_state()
calls and resolve timed transitions.This example shows how it would work (not tested, can contain errors):
The text was updated successfully, but these errors were encountered: