ccNOos  v0.0.0
Build Portable Microcontroller Applications!
Application_Platform_Main.c
Go to the documentation of this file.
1 /** \file WIN32_Console.cpp
2 * \brief WIN32 Console Implementation of ccNOos_Tests in c++
3 
4  Copyright 2021 InMechaSol, Inc
5 
6  Licensed under the Apache License, Version 2.0 (the "License");
7  you may not use this file except in compliance with the License.
8  You may obtain a copy of the License at
9 
10  http://www.apache.org/licenses/LICENSE-2.0
11 
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  See the License for the specific language governing permissions and
16  limitations under the License.
17 
18 Notes:
19 
20 */
21 
22 // Include all things ccNOos_tests, which is an application of ccNOos
23 // ccNOos_tests is the application solution
24 #include "..\testApps\SysTick\PlatformApp_Serialization.h"
25 
26 
27 ////////////////////////////////
28 // Compile Error if Examples/Tests not defining
29 #ifndef Mn
30  #error Mn must be defined - see examples
31 #endif
32 #ifndef MODdeclareCREATEINS
33  #error MODdeclareCREATEINS must be defined - see examples
34 #endif
35 #ifndef MODcallCREATEINS
36  #error MODcallCREATEINS must be defined - see examples
37 #endif
38 #ifdef __cplusplus
39  #ifndef PLATFORM_APP_CLASS
40  #error PLATFORM_APP_CLASS macro must be defined in application code
41  #endif
42 #else
43  #ifndef MODdeclareDATA
44  #error MODdeclareDATA macro must be defined in application code
45  #endif
46 #endif
47 
48 ////////////////////////////////
49 // Compile Error if Examples/Tests not defining
50 #if PLATFORM_NAME==PSoC4
51 #include <Platform_PSoC4.h>
52 #else
53 #error "No Platform Selected for Compile!"
54 #endif
55 
56 
57 ///////////////////////////////////////////////////////////////////////
58 // Module Data Structure or Module Data Class
59 // -Declared from Macro Template
60 // -Macro Template is Defined in the Application Solution Header
61 ///////////////////////////////////////////////////////////////////////
62 #ifdef __cplusplus
63  PLATFORM_APP_CLASS(Mn);
64 #else
66 #endif
67 
68 
69 
70 ///////////////////////////////////////////////////////////////////////
71 // SysTick Example
72 ///////////////////////////////////////////////////////////////////////
73 #if PLATFORM_NAME==Win32
74  // 1) Minute LED Device Write
76  // 2) Second LED Device Write
78  // 3) Serial Device Write
80  {
81  std::cout << MODdataPTR(Mn)->time;
82  }
83 #elif PLATFORM_NAME==PSoC4
84  // 1) Minute LED Device Write
86  {
87  //<writeMinLEDdevice>
88  LED_Min_Write(MODdataPTR(Mn)->MinLEDvalue);
89  //</writeMinLEDdevice>
90  }
91  // 2) Second LED Device Write
93  {
94  //<writeSecLEDdevice>
95  LED_Sec_Write(MODdataPTR(Mn)->SecLEDvalue);
96  //</writeSecLEDdevice>
97  }
98  // 3) Serial Device Write
100  {
101  //<writeSerialdevice>
102  UART_PutString(MODdataPTR(Mn)->time);
103  //</writeSerialdevice>
104  }
105 #elif PLATFORM_NAME==QTCreatorC
106  // 1) Minute LED Device Write
107  void WriteMinLED(MODdeclarePTRIN(Mn)) { ; }
108  // 2) Second LED Device Write
109  void WriteSecLED(MODdeclarePTRIN(Mn)) { ; }
110  // 3) Serial Device Write
112  {
113  printf("%s", MODdataPTR(Mn)->time);
114  fflush(stdout);
115  }
116 #elif PLATFORM_NAME==Arduino
117  // 1) Minute LED Device Write
118  void WriteMinLED(MODdeclarePTRIN(Mn)) { ; }
119  // 2) Second LED Device Write
120  void WriteSecLED(MODdeclarePTRIN(Mn)) { ; }
121  // 3) Serial Device Write
123  {
124  Serial.write("\r");
125  Serial.write(MODdataPTR(Mn)->time);
126  Serial.write("\n");
127  }
128 #else
129 #error "No Platform Selected for EXAMPLE!"
130 #endif
131 
132 
133 
134 
135 
136 
137 
138 
139 
140 ///////////////////////////////////////////////////////////////////////
141 // Application Data Instances are Created here (Platform Specific)
142 #ifdef __cplusplus
143 theApplicationClass theApplicationExample;
144 #else
146 #endif
147 
148 ////////////////////////////////////////////////////////////////////////////////
149 // Platform Main Entry Points call ExeSys Area Functions
150 #ifdef MAIN_C_NOos_Wsystick
152 #endif
153 #ifdef MAIN_C_NOos_NOsystick
155 #endif
PLATFORM_APP_CTEMPLATE
#define PLATFORM_APP_CTEMPLATE(MODNAME)
Definition: Application_Solution.h:117
WriteSecLED
void WriteSecLED(MODdeclarePTRIN(Mn))
Definition: Application_Platform_Main.c:77
MODdeclarePTRIN
#define MODdeclarePTRIN(mNAME)
Definition: version_config.h:284
Mn
#define Mn
Definition: Application_Solution.h:32
WriteTimeSerial
void WriteTimeSerial(MODdeclarePTRIN(Mn))
Definition: Application_Platform_Main.c:79
WriteMinLED
void WriteMinLED(MODdeclarePTRIN(Mn))
Definition: Application_Platform_Main.c:75
C_NOos_MAINnSYSTICK_TEMPLATE
#define C_NOos_MAINnSYSTICK_TEMPLATE
Definition: version_config.h:353
MODdataPTR
#define MODdataPTR(mNAME)
Definition: version_config.h:244
C_OS_MAIN_TEMPLATE
#define C_OS_MAIN_TEMPLATE
Definition: version_config.h:383
MODdeclareDATA
MODdeclareDATA(Mn)
Platform_PSoC4.h
IMS: ccNOos, Platform Specification, PSoC4