CORDET Framework - C2 Implementation
CrPsCmdPrgrFailCreate.c
Go to the documentation of this file.
1 
24 #include "CrPsCmdPrgrFailCreate.h"
25 
27 #include "FwPrDCreate.h"
28 #include "FwPrConfig.h"
29 #include <CrFwConstants.h>
31 #include <stdlib.h>
32 
33 
34 /* ----------------------------------------------------------------------------------------------------------------- */
36 FwPrBool_t CrPsCmdPrgrFailG1E(FwPrDesc_t prDesc)
37 {
38  CRFW_UNUSED(prDesc);
39  /* [ Else ] */
40  return 1;
41 }
42 
43 /* ----------------------------------------------------------------------------------------------------------------- */
44 FwPrDesc_t CrPsCmdPrgrFailCreate(void* prData)
45 {
46  const FwPrCounterU2_t DECISION2 = 1; /* The identifier of decision node DECISION2 in procedure CrPsCmdPrgrFail */
47  const FwPrCounterU2_t N_OUT_OF_DECISION2 = 2; /* The number of control flows out of decision node DECISION2 in procedure CrPsCmdPrgrFail */
48 
50  FwPrDesc_t prDesc = FwPrCreate(
51  5, /* N_ANODES - The number of action nodes */
52  1, /* N_DNODES - The number of decision nodes */
53  8, /* N_FLOWS - The number of control flows */
54  5, /* N_ACTIONS - The number of actions */
55  2 /* N_GUARDS - The number of guards */
56  );
57 
59  FwPrSetData(prDesc, prData);
60  FwPrAddActionNode(prDesc, CrPsCmdPrgrFail_N2, &CrPsCmdPrgrFailN2);
61  FwPrAddDecisionNode(prDesc, DECISION2, N_OUT_OF_DECISION2);
62  FwPrAddActionNode(prDesc, CrPsCmdPrgrFail_N3, &CrPsCmdPrgrFailN3);
63  FwPrAddActionNode(prDesc, CrPsCmdPrgrFail_N4, &CrPsCmdPrgrFailN4);
64  FwPrAddActionNode(prDesc, CrPsCmdPrgrFail_N5, &CrPsCmdPrgrFailN5);
65  FwPrAddActionNode(prDesc, CrPsCmdPrgrFail_N6, &CrPsCmdPrgrFailN6);
66  FwPrAddFlowIniToAct(prDesc, CrPsCmdPrgrFail_N2, NULL);
67  FwPrAddFlowActToDec(prDesc, CrPsCmdPrgrFail_N2, DECISION2, NULL);
68  FwPrAddFlowDecToAct(prDesc, DECISION2, CrPsCmdPrgrFail_N3, &CrPsCmdPrgrFailG1);
69  FwPrAddFlowDecToAct(prDesc, DECISION2, CrPsCmdPrgrFail_N4, &CrPsCmdPrgrFailG1E);
70  FwPrAddFlowActToFin(prDesc, CrPsCmdPrgrFail_N3, NULL);
71  FwPrAddFlowActToAct(prDesc, CrPsCmdPrgrFail_N4, CrPsCmdPrgrFail_N5, NULL);
72  FwPrAddFlowActToAct(prDesc, CrPsCmdPrgrFail_N5, CrPsCmdPrgrFail_N6, NULL);
73  FwPrAddFlowActToFin(prDesc, CrPsCmdPrgrFail_N6, NULL);
74 
75  return prDesc;
76 }
#define CRFW_UNUSED(x)
A macro that can be used to specify that a function parameter is not used.
Definition: CrFwConstants.h:27
FwPrDesc_t CrPsCmdPrgrFailCreate(void *prData)
Create a new procedure descriptor.
void CrPsCmdPrgrFailN3(FwPrDesc_t prDesc)
Action for node N3.
void CrPsCmdPrgrFailN4(FwPrDesc_t prDesc)
Action for node N4.
Header file to define all invariant publicly available constants and types for the CORDET Framework...
#define CrPsCmdPrgrFail_N2
Make sure to include this header file only once.
void CrPsCmdPrgrFailN6(FwPrDesc_t prDesc)
Action for node N6.
FwPrBool_t CrPsCmdPrgrFailG1(FwPrDesc_t prDesc)
Guard on the Control Flow from DECISION2 to N3.
void CrPsCmdPrgrFailN2(FwPrDesc_t prDesc)
Action for node N2.
Create one instance of the CrPsCmdPrgrFail procedure.
void CrPsCmdPrgrFailN5(FwPrDesc_t prDesc)
Action for node N5.
FwPrBool_t CrPsCmdPrgrFailG1E(FwPrDesc_t prDesc)
FW Profile function definitions.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved