SinelaboreRT Header Logo

SinelaboreRT

As simple as possible, but not any simpler!

User Tools

Site Tools


wiki:news:10oct2013

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
wiki:news:10oct2013 [2013/09/22 20:39] pmuellerwiki:news:10oct2013 [2013/09/22 20:45] 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 structures that contain all local data a function needs access to. When calling that function a pointer to such a structure is handed over. In our case the function is the state machine handler. And the structure contains all the state variables etc. need by the state machine. The code generator automatically creates all that for you.+Luckily in C there is also a well known concept to do this. Instead of defining objects you define a (instance) structure that contains all local data a function needs. When calling that function a pointer to the instance data structure is handed over. In our case the function is the state machine handler. The code generator automatically creates the instance data structure automatically for you.
  
 In this example we will show you how to "create multiple instances" of the state machine. In this example we will show you how to "create multiple instances" of the state machine.
wiki/news/10oct2013.txt · Last modified: 2022/08/17 19:44 by pmueller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki