Skip to content
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

Add Raspberry Pi Sample #43

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft

Add Raspberry Pi Sample #43

wants to merge 17 commits into from

Conversation

stuartmscott
Copy link
Member

No description provided.

samples/rpi/blinky.cpp Outdated Show resolved Hide resolved
samples/rpi/blinky.cpp Outdated Show resolved Hide resolved
@winksaville
Copy link
Collaborator

Did you miss my comments?

Also I looked at Machine::Goto and I do see that it executes onExit and onEnter immediately. I believe that leads to infinite recursion if you call GotoState("self") from onExit or onEnter. The simplicity to your GotoState is nice, but so easily shooting yourself in the foot isn't.

Also, as I mentioned before, I believe exiting the current child/parent states and then entering new parent/child states is more logical is desirable. But even if you don't like the entering/exiting the hierarchy, delaying the actual transition until after the current message is "processed" eliminates that self inflicted wound.

One last point, it can be useful if the message that is associated with the onExit/onEnter is passed to those routines so they can do different things based on the message.

@stuartmscott
Copy link
Member Author

Did you miss my comments?

Yeah sorry I was in the flow; editing on my laptop, (force) pushing here, pulling onto RPi and testing, should have marked this as a draft from the start

Also I looked at Machine::Goto and I do see that it executes onExit and onEnter immediately. I believe that leads to infinite recursion if you call GotoState("self") from onExit or onEnter. The simplicity to your GotoState is nice, but so easily shooting yourself in the foot isn't.

In any system transitioning to "self" is an infinite loop and it will not be lively, but I see your point that this is recursive and will blow the stack.

Also, as I mentioned before, I believe exiting the current child/parent states and then entering new parent/child states is more logical is desirable.

Yeah I agree, created #45

winksaville
winksaville previously approved these changes Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants