I am facing the problem of migrating a C application consisting of different parallel Finite-State-Machines (FSM) to a new plattform (YOCTO/Linux based). The C application has been developed for running on a Cortex M3 based Microcontroller using the Keil RTOS.
The implementation of the FSM was done in a naive way where each FSM is written in an own RTOS-task (basically just a C method). Inside these methods is just a big switch statement which determines the behaviour based on the current state (int variable). FSM interact with each other using global variables, guarded by a Mutex, or Events.
Since we ran into some hardware limitation and also having no real-time requirement I am planning to migrate the software to a Yocto-based system using C++ and Qt, supporting parallel and Sub-Statemachines. Additionally a GUI should be part of the system using QT QML.
My question is: Is there some kind of best practice of achieving the desired funtionality? Is there maybe some kind of code generation for the FSMs out of an UML diagram using some tool (Enterprise Architect, etc)? I have read about the QT StateMachine Framework and the SCXML support, would these be the best way to go?
I am glad for any help.