ccNOos  v0.0.0
Build Portable Microcontroller Applications!
Macros | Functions
Application_Solution.h File Reference

IMS: ccNOos, Declarations for straight C and C++ More...

#include "execution_system.h"
#include "console_menu.h"
#include "satComControl.h"
#include "APTmodule.h"
#include "TPMmodule.h"
#include "TxRxmodule.h"
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   SatComACS
 
#define MODdeclareCREATEINS
 
#define MODcallCREATEINS
 
#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)
 

Detailed Description

IMS: ccNOos, Declarations for straight C and C++

Copyright 2021 InMechaSol, Inc

Licensed under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Notes: (.c includes .h) - for straight C or (.cpp includes .c which includes .h) - for C++ wrapped straight C Always compiled to a single compilation unit, either C or CPP, not both

Definition in file Application_Solution.h.

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 158 of file Application_Solution.h.

◆ Mn

#define Mn   SatComACS

Definition at line 41 of file Application_Solution.h.

◆ MODcallCREATEINS

#define MODcallCREATEINS

Definition at line 62 of file Application_Solution.h.

◆ MODdeclareCREATEINS

#define MODdeclareCREATEINS

Definition at line 61 of file Application_Solution.h.

◆ PLATFORM_APP_CTEMPLATE

#define PLATFORM_APP_CTEMPLATE (   MODNAME)    __PLATFORM_APP_CTEMPLATE(MODNAME)

Definition at line 180 of file Application_Solution.h.

Function Documentation

◆ 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 46 of file Application_Solution.h.

47 {
49  // satComACS Terminal Module
50  struct antennaStruct Terminal;
51  // satComACS Device Modules
52  struct aptStruct APT;
53  struct wmmStruct WMM;
54  struct tpmStruct TPM;
55  struct txRxStruct TxRx;
56  // satComACS API Device Modules
57  struct uiStruct LCDKeyPad;
58  struct uiStruct ConsoleMenu;
59 };

◆ 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: Application_Solution.c:376
Mn
MODdeclareCREATE() Mn(MODdeclareCREATEINS)
Definition: Application_Solution.c:29
MODstructCREATE
#define MODstructCREATE(mNAME)
Definition: version_config.h:268
CLEAR_MODULE_ERRORS
#define CLEAR_MODULE_ERRORS(mNAME)
Definition: version_config.h:339
computeModuleStruct
Definition: compute_module.h:33
executionEntryStruct
Definition: execution_system.h:124
Mn
#define Mn
Definition: Application_Solution.h:41
COMPMODFIRST
#define COMPMODFIRST
Definition: version_config.h:280
MODprintMENU
#define MODprintMENU(mNAME)
Definition: version_config.h:260
MODDATAPTR_ERROR_RETURN
#define MODDATAPTR_ERROR_RETURN(mNAME)
Definition: version_config.h:331
MODdataINST
#define MODdataINST(mNAME)
Definition: version_config.h:240
uSEC_PER_CLOCK
#define uSEC_PER_CLOCK
Definition: Platform_Arduino.h:45
wmmStruct
Definition: APTmodule.h:66
antennaStruct
Definition: satComControl.h:94
IF_MODULE_ERROR
#define IF_MODULE_ERROR(mNAME)
Definition: version_config.h:335
MODparseINPUT
#define MODparseINPUT(mNAME)
Definition: version_config.h:264
txRxStruct
Definition: TxRxmodule.h:38
ExceptionsTest
UI_16 ExceptionsTest(MODdeclarePTRIN(Mn))
Definition: Application_Solution.c:403
CreateExecutionSystemStruct
struct executionSystemStruct CreateExecutionSystemStruct(UI_32 uSperTick)
Definition: execution_system.c:31
aptStruct
Definition: APTmodule.h:57
charBuffMax
#define charBuffMax
Definition: version_config.h:78
MODdeclareSTRUCT
#define MODdeclareSTRUCT(mNAME)
Definition: version_config.h:277
tpmStruct
Definition: TPMmodule.h:56
MODdataPTR
#define MODdataPTR(mNAME)
Definition: version_config.h:244
RETURN_TEST_IN_PROGRESS
#define RETURN_TEST_IN_PROGRESS
Definition: Application_Solution.h:76
linkedEntryPointStruct
Definition: execution_system.h:115
RETURN_TEST_PASSED
#define RETURN_TEST_PASSED
Definition: Application_Solution.h:75
CreateComputeModuleStruct
struct computeModuleStruct CreateComputeModuleStruct()
Definition: compute_module.c:30
RETURN_SUCCESS
#define RETURN_SUCCESS
Function Return Value for Success.
Definition: version_config.h:87
applicationConfig
void applicationConfig()