This lesson in the Modern Embedded Systems Programming Course demonstrates how to automatically generate C code from state machine models using the QM modeling tool. Starting from a manually written time bomb state machine, the instructor walks through setting up QM, defining logical design (classes, attributes, operations, state machines) and physical design (directories and files), then using $declare and $define directives to generate complete, compilable code. The lesson also covers practical concerns around code generation: avoiding 'fighting the tool', ensuring generated code is complete and read-only, integrating generated and hand-written code, bidirectional traceability between model and code, model versioning and diffing via XML, and scaling to large projects with external packages.

30m watch time
1 Impression