hsm
hsm copied to clipboard
How to split a large state machine into several small state machines and put them in different files
A large state machine results in many lines of code,so i want to put some sub states in other files,How can I achieve it thanks
Hi @mjt123. Yes, you're right, and not the first to bring this up. I need to add a section to the Wiki/Book about how to do this. In the meantime, here's an answer I gave to a similar question a while back: https://github.com/amaiorano/hsm/issues/9#issuecomment-352260330. See the very last paragraph for one way to split up large HSMs so that you have only the root state declared in header files. Let me know if this helps.
hi @amaiorano,it works.And as you said, dealing with dependencies between States is cumbersome. Thank you for your advice,expected seeing this part of the wiki.