Skip to content

Commit 915c679

Browse files
committedDec 12, 2023
docs: update README
1 parent 2f42f82 commit 915c679

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed
 

‎README.md

+18-1
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,26 @@ The main interface to the FSM in C is the `run_state` function. See at the end o
3838

3939
If you need an FSM for your Arduino, you can generate it with the command option `--ino`: this will generate a `.h` and a `.cpp` files, omitting all instructions that are not available on the Arduino (e.g. the `syslog` calls, which are replaced with `Serial.print calls`). Load these files in the IDE, require the header from the main `.ino` file, and call the FSM manager function from within the main `loop()` function.
4040

41+
## NEW in version 0.4
42+
43+
GV_FSM version 0.4.0 introduces a new mechanism to trigger state changes from outside the FSM using events.
44+
45+
The `event_data_t` typedef, like `state_data_t`, can be used to pass custom data when a new event is triggered.
46+
47+
Two functions are generated by default to trigger a new event or check if one is already fired.
48+
To change state when the event is triggered an explicit check has to be made inside of a state function, for example:
49+
50+
```c
51+
if (is_event_triggered())
52+
next_state = STATE_NEXT;
53+
```
54+
55+
> [!IMPORTANT]
56+
> Only one event at a time can be fired.
57+
4158
## NEW in version 0.3
4259

43-
Gem version o.3.0 introduces a new CLI option that enables the generation of code that support SIGINT signal management:
60+
GV_FSM version 0.3.0 introduces a new CLI option that enables the generation of code that support SIGINT signal management:
4461

4562
```bash
4663
gv_fsm fsm.dot -k stop

‎lib/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module GV_FSM
2-
VERSION = "0.4.4"
2+
VERSION = "0.4.0"
33
end

0 commit comments

Comments
 (0)
Please sign in to comment.