You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-16Lines changed: 7 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,7 @@ A compact C finite state machine (FSM) implementation that's easy to use on embe
16
16
-[Getting Started](#getting-started)
17
17
-[Introduction](#introduction)
18
18
-[Background](#background)
19
-
-[Project Build](#project-build)
20
-
-[Windows Visual Studio](#windows-visual-studio)
21
-
-[Linux Make](#linux-make)
19
+
-[Getting Started](#getting-started-1)
22
20
-[Why use a state machine?](#why-use-a-state-machine)
23
21
-[State machine design](#state-machine-design)
24
22
-[Internal and external events](#internal-and-external-events)
@@ -111,21 +109,14 @@ switch (currentState) {
111
109
112
110
<p>The first problem revolves around controlling what state transitions are valid and which ones are invalid. There is no way to enforce the state transition rules. Any transition is allowed at any time, which is not particularly desirable. For most designs, only a few transition patterns are valid. Ideally, the software design should enforce these predefined state sequences and prevent the unwanted transitions. Another problem arises when trying to send data to a specific state. Since the entire state machine is located within a single function, sending additional data to any given state proves difficult. And lastly these designs are rarely suitable for use in a multithreaded system. The designer must ensure the state machine is called from a single thread of control.</p>
113
111
114
-
# Project Build
115
-
116
-
<ahref="https://www.cmake.org">CMake</a> is used to create the build files. CMake is free and open-source software. Windows, Linux and other toolchains are supported. Example CMake console commands executed inside the project root directory:
117
-
118
-
## Windows Visual Studio
119
-
120
-
<code>cmake -G "Visual Studio 17 2022" -A Win32 -B Build -S .</code>
121
-
122
-
After executed, open the Visual Studio project from within the <code>Build</code> directory.
[CMake](https://cmake.org/) is used to create the project build files on any Windows or Linux machine. The state machine source code works on any C compiler on any platform.
127
115
128
-
After executed, build the software from within the Build directory using the command <code>make</code>. Run the console app using <code>./C_StateMachineApp</code>.
116
+
1. Clone the repository.
117
+
2. From the repository root, run the following CMake command:
118
+
`cmake -B Build .`
119
+
3. Build and run the project within the `Build` directory.
0 commit comments