Skip to content
This repository was archived by the owner on Nov 18, 2024. It is now read-only.

Add Raspberry Pi Sample - #43

Draft
stuartmscott wants to merge 17 commits into
mainfrom
blinky
Draft

stuartmscott wants to merge 17 commits into
mainfrom
blinky

Conversation

@stuartmscott

Copy link
Copy Markdown
Member

No description provided.

Comment thread samples/rpi/blinky.cpp Outdated
Comment thread samples/rpi/blinky.cpp Outdated
@stuartmscott
stuartmscott force-pushed the blinky branch 2 times, most recently from a8d7776 to 93af14d Compare January 14, 2023 23:42
@winksaville

Copy link
Copy Markdown
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
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants