IAR Visual State can generate code using the C language.
The Visual State project is set to generate C code (with C-SPY Link support) by default.
- Go to Project → Code generate (F9).
Note The generated code can be found on the local repository root directory, under the
VS_coder
folder.
- Go to File → Open Workspace and choose C/VisualStateDemo.eww.
- Choose Project → Download and Debug (Ctrl+D) to start executing the application.
- Choose View → Macros → Macros Quicklaunch.
- Choose
<click to add>
to add the following macros:pressButton1()
and repeat for addingpressButton2()
.
- Choose View → Live Watch.
- Choose
<click to add>
to add the following structures to the Live Watch window:LED_RED
,LED_YELLOW
andLED_GREEN
. Unfold them to see theirstate
member.
- Choose Visual State → Sampling Buffer Capture Settings → Live.
- Choose Visual State → View → Graphical Animation → System1.
- Press F5 to resume the program execution.
- In the Macros Quicklaunch window, double-click on the Recalculate icon for executing the associated C-SPY macros that will generate the events.