FW Profile - C1 Implementation
FwSmSCreate.h
Go to the documentation of this file.
1 
64 #ifndef FWSM_SCREATE_H_
65 #define FWSM_SCREATE_H_
66 
67 #include "FwSmCore.h"
68 #include "FwSmPrivate.h"
69 
113 #define FW_SM_INST(SM_DESC, NS, NCPS, NTRANS, NA, NG) \
114  static SmPState_t SM_DESC##_pState[(NS)]; \
115  static SmCState_t SM_DESC##_cState[(NCPS)]; \
116  static SmTrans_t SM_DESC##_trans[(NTRANS)]; \
117  static FwSmAction_t SM_DESC##_actions[(NA) + 1]; \
118  static FwSmGuard_t SM_DESC##_guards[(NG) + 1]; \
119  static FwSmDesc_t SM_DESC##_esm[(NS)]; \
120  static SmBaseDesc_t SM_DESC##_base = {(SM_DESC##_pState), (SM_DESC##_cState), (SM_DESC##_trans), NS, NCPS, NTRANS}; \
121  static struct FwSmDesc(SM_DESC) = {&(SM_DESC##_base), \
122  (SM_DESC##_actions), \
123  (SM_DESC##_guards), \
124  (SM_DESC##_esm), \
125  (NA) + 1, \
126  (NG) + 1, \
127  1, \
128  0, \
129  0, \
130  0, \
131  smSuccess, \
132  NULL};
133 
176 #define FW_SM_INST_NOCPS(SM_DESC, NS, NTRANS, NA, NG) \
177  static SmPState_t SM_DESC##_pState[(NS)]; \
178  static SmTrans_t SM_DESC##_trans[(NTRANS)]; \
179  static FwSmAction_t SM_DESC##_actions[(NA) + 1]; \
180  static FwSmGuard_t SM_DESC##_guards[(NG) + 1]; \
181  static FwSmDesc_t SM_DESC##_esm[(NS)]; \
182  static SmBaseDesc_t SM_DESC##_base = {(SM_DESC##_pState), NULL, (SM_DESC##_trans), NS, 0, NTRANS}; \
183  static struct FwSmDesc(SM_DESC) = {&(SM_DESC##_base), \
184  (SM_DESC##_actions), \
185  (SM_DESC##_guards), \
186  (SM_DESC##_esm), \
187  (NA) + 1, \
188  (NG) + 1, \
189  1, \
190  0, \
191  0, \
192  0, \
193  smSuccess, \
194  NULL};
195 
231 #define FW_SM_INST_DER(SM_DESC, NS, NA, NG) \
232  static FwSmAction_t SM_DESC##_actions[(NA) + 1]; \
233  static FwSmGuard_t SM_DESC##_guards[(NG) + 1]; \
234  static FwSmDesc_t SM_DESC##_esm[(NS)]; \
235  static struct FwSmDesc(SM_DESC) = \
236  { \
237  NULL, (SM_DESC##_actions), (SM_DESC##_guards), (SM_DESC##_esm), (NA) + 1, (NG) + 1, 1, 0, 0, 0, smSuccess, \
238  NULL};
239 
259 void FwSmInit(FwSmDesc_t smDesc);
260 
320 void FwSmInitDer(FwSmDesc_t smDesc, FwSmDesc_t smDescBase);
321 
322 #endif /* FWSM_SCREATE_H_ */
void FwSmInitDer(FwSmDesc_t smDesc, FwSmDesc_t smDescBase)
Initialize a state machine descriptor to extend another state machine (the base state machine)...
Definition: FwSmSCreate.c:54
Declaration of the execution interface for a FW State Machine.
Structure representing a state machine descriptor.
Definition: FwSmPrivate.h:303
void FwSmInit(FwSmDesc_t smDesc)
Initialize a state machine descriptor to represent an unconfigured state machine with no transitions...
Definition: FwSmSCreate.c:24
Declaration of the internal data structures of the FW State Machine Module.
P&P Software GmbH, Copyright 2011, All Rights Reserved