ccNOos  v0.0.0
Build Portable Microcontroller Applications!
Application_Solution.h File Reference
Include dependency graph for Application_Solution.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define Mn   ccNOosTests
 
#define charBuffMax   80
 
#define MODdeclareCREATEINS
 
#define MODcallCREATEINS
 
#define RETURN_TEST_PASSED   (0x0000)
 
#define RETURN_TEST_IN_PROGRESS   (0x0001)
 
#define RETURN_FAILED_TIMEDEXECUTION   (0x0010)
 
#define RETURN_FAILED_SERIALIZATION   (0x0100)
 
#define RETURN_FAILED_DESERIALIZATION   (0x0110)
 
#define RETURN_FAILED_COMPARISON   (0x0120)
 
#define __PLATFORM_APP_CTEMPLATE(MODNAME)
 
#define PLATFORM_APP_CTEMPLATE(MODNAME)   __PLATFORM_APP_CTEMPLATE(MODNAME)
 

Functions

 MODdeclareSTRUCT (Mn)
 
MODdeclareCREATE() Mn (MODdeclareCREATEINS)
 
 MODdeclareSETUP (Mn)
 
 MODdeclareLOOP (Mn)
 
 MODdeclareSYSTICK (Mn)
 
UI_16 TimedExecutionTest (MODdeclarePTRIN(Mn))
 
UI_16 ExceptionsTest (MODdeclarePTRIN(Mn))
 

Macro Definition Documentation

◆ __PLATFORM_APP_CTEMPLATE

#define __PLATFORM_APP_CTEMPLATE (   MODNAME)
Value:
struct linkedEntryPointStruct setupListHead = {\
nullptr,\
MODsetup(Mn)\
};\
struct linkedEntryPointStruct loopListHead = {\
nullptr,\
MODloop(Mn)\
};\
struct executionEntryStruct exeEntryPoints = {\
&setupListHead,\
&loopListHead,\
nullptr,\
&setupListHead\
};\
{\
MODdataINST(Mn) = MODstructCREATE(Mn)();\
}

Definition at line 95 of file Application_Solution.h.

◆ charBuffMax

#define charBuffMax   80

Definition at line 34 of file Application_Solution.h.

◆ Mn

#define Mn   ccNOosTests

Definition at line 32 of file Application_Solution.h.

◆ MODcallCREATEINS

#define MODcallCREATEINS

Definition at line 59 of file Application_Solution.h.

◆ MODdeclareCREATEINS

#define MODdeclareCREATEINS

Definition at line 58 of file Application_Solution.h.

◆ PLATFORM_APP_CTEMPLATE

#define PLATFORM_APP_CTEMPLATE (   MODNAME)    __PLATFORM_APP_CTEMPLATE(MODNAME)

Definition at line 117 of file Application_Solution.h.

◆ RETURN_FAILED_COMPARISON

#define RETURN_FAILED_COMPARISON   (0x0120)

Definition at line 80 of file Application_Solution.h.

◆ RETURN_FAILED_DESERIALIZATION

#define RETURN_FAILED_DESERIALIZATION   (0x0110)

Definition at line 79 of file Application_Solution.h.

◆ RETURN_FAILED_SERIALIZATION

#define RETURN_FAILED_SERIALIZATION   (0x0100)

Definition at line 78 of file Application_Solution.h.

◆ RETURN_FAILED_TIMEDEXECUTION

#define RETURN_FAILED_TIMEDEXECUTION   (0x0010)

Definition at line 77 of file Application_Solution.h.

◆ RETURN_TEST_IN_PROGRESS

#define RETURN_TEST_IN_PROGRESS   (0x0001)

Definition at line 76 of file Application_Solution.h.

◆ RETURN_TEST_PASSED

#define RETURN_TEST_PASSED   (0x0000)

Definition at line 75 of file Application_Solution.h.

Function Documentation

◆ ExceptionsTest()

UI_16 ExceptionsTest ( MODdeclarePTRIN(Mn )

Definition at line 403 of file Application_Solution.c.

404 {
405 
406  return RETURN_TEST_PASSED;
407 }

◆ Mn()

Definition at line 29 of file Application_Solution.c.

30 {
31  MODdeclareSTRUCT(Mn) outStruct;
32  outStruct.compMod = CreateComputeModuleStruct();
33 
34  outStruct.float_0 = 0.0;
35  outStruct.float_1 = outStruct.float_0;
36  outStruct.double_0 = 0.0;
37  outStruct.double_1 = outStruct.double_0;
38 
39  outStruct.ui64_0 = 0.0;
40  outStruct.ui64_1 = outStruct.ui64_0;
41  outStruct.i64_0 = 0.0;
42  outStruct.i64_1 = outStruct.i64_0;
43 
44  outStruct.ui32_0 = 0.0;
45  outStruct.ui32_1 = outStruct.ui32_0;
46  outStruct.i32_0 = 0.0;
47  outStruct.i32_1 = outStruct.i32_0;
48 
49  outStruct.ui16_0 = 0.0;
50  outStruct.ui16_1 = outStruct.ui16_0;
51  outStruct.i16_0 = 0.0;
52  outStruct.i16_1 = outStruct.i16_0;
53 
54  outStruct.ui8_0 = 0.0;
55  outStruct.ui8_1 = outStruct.ui8_0;
56  outStruct.i8_0 = 0.0;
57  outStruct.i8_1 = outStruct.i8_0;
58 
59  outStruct.charsRead = 1u;
60  outStruct.chars2Write = 0u;
61 
62 #ifdef __USINGCONSOLEMENU
63  UI_8 i = 0;
64  for (i = 0; i < charBuffMax; i++)
65  outStruct.charbuff_In[i] = 0x00;
66  for (i = 0; i < charBuffMax; i++)
67  outStruct.charbuff_Out[i] = 0x00;
68 
69 #endif
70 
71  outStruct.SerializationTestReturn = RETURN_TEST_PASSED;
72  outStruct.TestState = 0x0000;
73 
74  return outStruct;
75 }

◆ MODdeclareLOOP()

MODdeclareLOOP ( Mn  )

Definition at line 116 of file Application_Solution.c.

117 {
119 
120  UI_16 TestReturn = 0;
121  switch (MODdataPTR(Mn)->TestState)
122  {
123  case 0x0000:// Timed Execution Loop Test
124  TestReturn = TimedExecutionTest(MODdataPTR(Mn));
125  MODdataPTR(Mn)->TimedExecutionTestReturn = TestReturn;
126  if (TestReturn != RETURN_TEST_IN_PROGRESS)
127  MODdataPTR(Mn)->TestState++;
128  break;
129  case 0x0001:// Exception Loop Test
130  TestReturn = ExceptionsTest(MODdataPTR(Mn));
131  MODdataPTR(Mn)->ExceptionsTestReturn = TestReturn;
132  if (TestReturn != RETURN_TEST_IN_PROGRESS)
133  MODdataPTR(Mn)->TestState++;
134  break;
135  default:// Done!!!
136  if (MODdataPTR(Mn)->SerializationTestReturn == RETURN_TEST_PASSED
137  && MODdataPTR(Mn)->TimedExecutionTestReturn == RETURN_TEST_PASSED
138  && MODdataPTR(Mn)->ExceptionsTestReturn == RETURN_TEST_PASSED)
139  MODdataPTR(Mn)->TestState = 0xffff;
140  else
141  MODdataPTR(Mn)->TestState = 0xfffe;
142  break;
143  case 0xfffe:// Done - Failed
144  case 0xffff:// Done - Passed
145 #ifdef __USINGCONSOLEMENU
146  MODdataPTR(Mn)->ui16_0 = MODprintMENU(Mn)(compModPtrIn);
147  MODdataPTR(Mn)->ui16_0 = MODparseINPUT(Mn)(compModPtrIn);
148 #endif
149  break;
150  }
151 
152 
153 
154  return RETURN_SUCCESS;
155 }

◆ MODdeclareSETUP()

MODdeclareSETUP ( Mn  )

Definition at line 79 of file Application_Solution.c.

80 {
82 
83  // Setup is running in the loop area to handle exceptions...
85  {
86  CLEAR_MODULE_ERRORS(Mn); // do nothing, clear flags
87  }
88  // Setup is running in the setup area following power on
89  else
90  {
91  UI_16 TestReturn = 0;
92  TestReturn = ExceptionsTest(MODdataPTR(Mn));
93  MODdataPTR(Mn)->ExceptionsTestReturn = TestReturn;
94 
95  // Basic Platfrom Serialization / Deserialization if Included
96 #ifdef __USINGCONSOLEMENU
97  TestReturn = SerializationTest(MODdataPTR(Mn));
98  MODdataPTR(Mn)->SerializationTestReturn = TestReturn;
99  MODdataPTR(Mn)->charbuff_In[0] = ';';
100  MODdataPTR(Mn)->ui16_0 = MODprintMENU(Mn)(compModPtrIn);
101  //MODdataPTR(Mn)->ui16_0 = MODparseINPUT(Mn)(compModPtrIn);
102 #endif
103 
104 // initialize values for timedexecutiontest in loop
105  MODdataPTR(Mn)->ui32_0 = 0;
106  MODdataPTR(Mn)->ui32_1 = 0;
107  MODdataPTR(Mn)->ui16_0 = 0;
108  MODdataPTR(Mn)->ui16_1 = 0;
109 
110 
111  }
112  return RETURN_SUCCESS;
113 }

◆ MODdeclareSTRUCT()

MODdeclareSTRUCT ( Mn  )

Definition at line 36 of file Application_Solution.h.

37 {
39  float float_0, float_1;
40  double double_0, double_1;
41  UI_64 ui64_0, ui64_1;
42  I_64 i64_0, i64_1;
43  UI_32 ui32_0, ui32_1;
44  I_32 i32_0, i32_1;
45  UI_16 ui16_0, ui16_1;
46  I_16 i16_0, i16_1;
47  UI_8 ui8_0, ui8_1;
48  I_8 i8_0, i8_1;
49  UI_8 charsRead, chars2Write;
50  char charbuff_In[charBuffMax];
51  char charbuff_Out[charBuffMax];
52  UI_16 SerializationTestReturn;
53  UI_16 TimedExecutionTestReturn;
54  UI_16 ExceptionsTestReturn;
55  UI_16 TestState;
56 };

◆ MODdeclareSYSTICK()

MODdeclareSYSTICK ( Mn  )

Definition at line 157 of file Application_Solution.c.

157 { ; } // do nothing in the systick area

◆ TimedExecutionTest()

UI_16 TimedExecutionTest ( MODdeclarePTRIN(Mn )

Definition at line 376 of file Application_Solution.c.

377 {
378 #define uSNOW MODdataPTR(Mn)->ui32_0
379 #define uSTHEN MODdataPTR(Mn)->ui32_1
380 #define LOOPCYCLES MODdataPTR(Mn)->ui16_0
381 
382  uSNOW = getuSecTicks();
383 
384  if (++LOOPCYCLES == 0)
386  else if (LOOPCYCLES == 1)
387  uSTHEN = getuSecTicks();
388 
389  if ((uSNOW - uSTHEN) >= getuSecPerSysTick())
390  {
391  LOOPCYCLES = 0;
392  return RETURN_TEST_PASSED;
393  }
394  else
395  {
397  }
398 
399 #undef uSNOW
400 #undef uSTHEN
401 #undef LOOPCYCLES
402 }
charBuffMax
#define charBuffMax
Definition: version_config.h:78
computeModuleStruct
Definition: compute_module.h:33
uSNOW
#define uSNOW
executionEntryStruct
Definition: execution_system.h:124
MODdeclareSTRUCT
#define MODdeclareSTRUCT(mNAME)
Definition: version_config.h:277
Mn
#define Mn
Definition: Application_Solution.h:32
RETURN_TEST_PASSED
#define RETURN_TEST_PASSED
Definition: Application_Solution.h:75
MODparseINPUT
#define MODparseINPUT(mNAME)
Definition: version_config.h:264
LOOPCYCLES
#define LOOPCYCLES
RETURN_FAILED_TIMEDEXECUTION
#define RETURN_FAILED_TIMEDEXECUTION
Definition: Application_Solution.h:77
CreateExecutionSystemStruct
struct executionSystemStruct CreateExecutionSystemStruct(UI_32 uSperTick)
Definition: execution_system.c:31
MODdataINST
#define MODdataINST(mNAME)
Definition: version_config.h:240
TimedExecutionTest
UI_16 TimedExecutionTest(MODdeclarePTRIN(Mn))
Definition: Application_Solution.c:376
Mn
MODdeclareCREATE() Mn(MODdeclareCREATEINS)
Definition: Application_Solution.c:29
RETURN_TEST_IN_PROGRESS
#define RETURN_TEST_IN_PROGRESS
Definition: Application_Solution.h:76
RETURN_SUCCESS
#define RETURN_SUCCESS
Function Return Value for Success.
Definition: version_config.h:87
linkedEntryPointStruct
Definition: execution_system.h:115
MODdataPTR
#define MODdataPTR(mNAME)
Definition: version_config.h:244
charBuffMax
#define charBuffMax
Definition: Application_Solution.h:34
COMPMODFIRST
#define COMPMODFIRST
Definition: version_config.h:280
IF_MODULE_ERROR
#define IF_MODULE_ERROR(mNAME)
Definition: version_config.h:335
uSTHEN
#define uSTHEN
CLEAR_MODULE_ERRORS
#define CLEAR_MODULE_ERRORS(mNAME)
Definition: version_config.h:339
ExceptionsTest
UI_16 ExceptionsTest(MODdeclarePTRIN(Mn))
Definition: Application_Solution.c:403
MODprintMENU
#define MODprintMENU(mNAME)
Definition: version_config.h:260
applicationConfig
void applicationConfig()
MODDATAPTR_ERROR_RETURN
#define MODDATAPTR_ERROR_RETURN(mNAME)
Definition: version_config.h:331
CreateComputeModuleStruct
struct computeModuleStruct CreateComputeModuleStruct()
Definition: compute_module.c:30
getuSecPerSysTick
UI_32 getuSecPerSysTick()
getuSecTicks
UI_32 getuSecTicks()
uSEC_PER_CLOCK
#define uSEC_PER_CLOCK
Definition: Platform_Arduino.h:45
MODstructCREATE
#define MODstructCREATE(mNAME)
Definition: version_config.h:268