CORDET Framework - C2 Implementation
CrPsCmdPrgrSuccCreate.c
Go to the documentation of this file.
1 
24 #include "CrPsCmdPrgrSuccCreate.h"
25 
27 #include "FwPrDCreate.h"
28 #include "FwPrConfig.h"
29 #include <CrFwConstants.h>
31 #include <stdlib.h>
32 
33 
34 /* ----------------------------------------------------------------------------------------------------------------- */
36 FwPrBool_t CrPsCmdPrgrSuccG1E(FwPrDesc_t prDesc)
37 {
38  CRFW_UNUSED(prDesc);
39  /* [ Else ] */
40  return 1;
41 }
42 
43 /* ----------------------------------------------------------------------------------------------------------------- */
44 FwPrDesc_t CrPsCmdPrgrSuccCreate(void* prData)
45 {
46  const FwPrCounterU2_t DECISION2 = 1; /* The identifier of decision node DECISION2 in procedure CrPsCmdPrgrSucc */
47  const FwPrCounterU2_t N_OUT_OF_DECISION2 = 2; /* The number of control flows out of decision node DECISION2 in procedure CrPsCmdPrgrSucc */
48 
50  FwPrDesc_t prDesc = FwPrCreate(
51  3, /* N_ANODES - The number of action nodes */
52  1, /* N_DNODES - The number of decision nodes */
53  6, /* N_FLOWS - The number of control flows */
54  3, /* N_ACTIONS - The number of actions */
55  2 /* N_GUARDS - The number of guards */
56  );
57 
59  FwPrSetData(prDesc, prData);
60  FwPrAddActionNode(prDesc, CrPsCmdPrgrSucc_N2, &CrPsCmdPrgrSuccN2);
61  FwPrAddDecisionNode(prDesc, DECISION2, N_OUT_OF_DECISION2);
62  FwPrAddActionNode(prDesc, CrPsCmdPrgrSucc_N3, &CrPsCmdPrgrSuccN3);
63  FwPrAddActionNode(prDesc, CrPsCmdPrgrSucc_N4, &CrPsCmdPrgrSuccN4);
64  FwPrAddFlowIniToAct(prDesc, CrPsCmdPrgrSucc_N2, NULL);
65  FwPrAddFlowActToDec(prDesc, CrPsCmdPrgrSucc_N2, DECISION2, NULL);
66  FwPrAddFlowDecToAct(prDesc, DECISION2, CrPsCmdPrgrSucc_N3, &CrPsCmdPrgrSuccG1);
67  FwPrAddFlowDecToAct(prDesc, DECISION2, CrPsCmdPrgrSucc_N4, &CrPsCmdPrgrSuccG1E);
68  FwPrAddFlowActToFin(prDesc, CrPsCmdPrgrSucc_N3, NULL);
69  FwPrAddFlowActToFin(prDesc, CrPsCmdPrgrSucc_N4, NULL);
70 
71  return prDesc;
72 }
#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 CrPsCmdPrgrSuccCreate(void *prData)
Create a new procedure descriptor.
FwPrBool_t CrPsCmdPrgrSuccG1(FwPrDesc_t prDesc)
Guard on the Control Flow from DECISION2 to N3.
Create one instance of the CrPsCmdPrgrSucc procedure.
Header file to define all invariant publicly available constants and types for the CORDET Framework...
void CrPsCmdPrgrSuccN3(FwPrDesc_t prDesc)
Action for node N3.
FwPrBool_t CrPsCmdPrgrSuccG1E(FwPrDesc_t prDesc)
FW Profile function definitions.
void CrPsCmdPrgrSuccN2(FwPrDesc_t prDesc)
Action for node N2.
void CrPsCmdPrgrSuccN4(FwPrDesc_t prDesc)
Action for node N4.
#define CrPsCmdPrgrSucc_N2
Make sure to include this header file only once.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved