wiki:news:10oct2013
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
wiki:news:10oct2013 [2013/09/22 20:39] – pmueller | wiki:news:10oct2013 [2022/08/17 19:44] (current) – Discussion status changed pmueller | ||
---|---|---|---|
Line 3: | Line 3: | ||
Sometimes you want to run the same state machine multiple times. E.g. processing three serial interfaces with the same state machine. In object orient languages this is easy as the concept of objects is the basis of these languages. You would simply instantiate the class three times. | Sometimes you want to run the same state machine multiple times. E.g. processing three serial interfaces with the same state machine. In object orient languages this is easy as the concept of objects is the basis of these languages. You would simply instantiate the class three times. | ||
- | Luckily in C there there is also a well known concept to do this. Instead of defining objects you define | + | Luckily in C there is also a well known concept to do this. Instead of defining objects you define |
In this example we will show you how to " | In this example we will show you how to " | ||
Line 23: | Line 23: | ||
You can now simply declare multiple variables of type TESTCASE_INSTANCEDATA_T which contains the data per instance. When calling the state machine just point to one of these variables. | You can now simply declare multiple variables of type TESTCASE_INSTANCEDATA_T which contains the data per instance. When calling the state machine just point to one of these variables. | ||
- | To let the state machine | + | Sometimes it is necessary that a state machine |
<code c> | <code c> | ||
Line 50: | Line 50: | ||
===== Provide an own Instance Structure ===== | ===== Provide an own Instance Structure ===== | ||
- | Sometimes it makes sense to provide an own instance structure. In our example we want to store the baud rate, parity and other values relevant for each serial port. So the state machine can store there all local data and makes it " | + | Sometimes it makes sense to provide an own instance structure. In our example we want to store the baud rate, parity and other values relevant for each serial port. |
- | So first define an own struct in a file called '' | + | So first define an own struct in a file called '' |
<code c> | <code c> | ||
Line 119: | Line 119: | ||
- | {(rater> | + | |
- | ~~DISCUSSION|Leave your comments~~ | + | ~~DISCUSSION:closed|Leave your comments~~ |
wiki/news/10oct2013.1379875199.txt.gz · Last modified: 2013/09/22 20:39 by pmueller