ccNOos  v0.0.0
Build Portable Microcontroller Applications!
Platform_QTCreatorC.h
Go to the documentation of this file.
1 /** \file Platform_QTCreatorC.h
2 * \brief <a href="https://www.inmechasol.org/" target="_blank">IMS</a>:
3  <a href="https://github.com/InMechaSol/ccNOos" target="_blank">ccNOos</a>,
4  Platform Specification, QTCreatorC
5 
6  Copyright 2021 <a href="https://www.inmechasol.org/" target="_blank">InMechaSol, Inc</a>
7 
8  Licensed under the Apache License, Version 2.0(the "License");
9  you may not use this file except in compliance with the License.
10  You may obtain a copy of the License at
11 
12  http://www.apache.org/licenses/LICENSE-2.0
13 
14  Unless required by applicable law or agreed to in writing, software
15  distributed under the License is distributed on an "AS IS" BASIS,
16  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  See the License for the specific language governing permissions and
18  limitations under the License.
19 
20 Notes:
21  (.c includes .h) - for straight C or
22  (.cpp includes .c which includes .h) - for C++ wrapped straight C
23  *Always compiled to a single compilation unit, either C or CPP, not both
24 
25 */
26 
27 #if PLATFORM_NAME!=QTCreatorC
28  error PLATFORM_NAME must be QTCreatorC
29 #endif
30 
31 
32 #ifdef REDEFINE_NULLPTR
33 #error Must not compile with -DREDEFINE_NULLPTR on QTCreatorC
34 #endif // !REDEFINE_NULLPTR
35 #ifdef __NOEXCEPTIONS
36 #error Must not compile with -D__NOEXCEPTIONS on QTCreatorC
37 #endif // !__NOEXCEPTIONS
38 
39 
40 #include <stdio.h>
41 #include <stdlib.h>
42 #include <time.h>
43 #include <unistd.h>
44 #include <stdarg.h>
45 #include <pthread.h>
46 
47 
48 #include "execution_system.h"
49 #include "console_menu.h"
50 
51 //void SysTickISRCallback(void); // not using on QTCreatorC
52 #define LIGHT_OFF (1u) // 1-PSoC4, 0-most others
53 #define uSEC_PER_CLOCK (1000000/CLOCKS_PER_SEC)
54 
55 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
56 // QTCreator_C is a special platfrom, it's a ccNOos test platform but, can link-in os features at the main file
57 // - it can also run on either linux or windows, this is a unique test platform in that regard
58 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
59 #include "serial_comms.h"
60 #include "adafruit_ft232h.h"
61 
62 struct portParametersStruct GPSPortParams;
63 struct portParametersStruct eCompPortParams;
64 
67 
68 // 0) (Optional) Platform Config and Log Files/Devices
69 
70 // 1) Platform Setup Function
72 {
73 
74 #ifdef _WIN32
75  GPSPortParams = buildportParametersStruct("\\\\.\\COM29",9600);
76  eCompPortParams = buildportParametersStruct("\\\\.\\COM4",19200);
77 #else
78  GPSPortParams = buildportParametersStruct("/dev/tty1",9600);
79  eCompPortParams = buildportParametersStruct("/dev/tty2",19200);
80 #endif
81 
82  openComPort(&GPSPortParams);
83  openComPort(&eCompPortParams);
84 
87 
88  //<platformSetup>
89  //
90  // open config device
91 
92 
93  // read config string??
94  //
95  // open log device
96  // wrtie log string??
97  //
98  //</platformSetup>
99 }
100 // 2) Platform Start Function
102 {
103  //<platformStart>
104  //</platformStart>
105 }
106 // 3) Platform Loop Delay Function
108 {
109  //<platformLoopDelay>
110  usleep(1000);
111  //</platformLoopDelay>
112 }
113 
114 #ifdef __USINGCONSOLEMENU
115 // 8) Platform API Functions (From Template?)
116 PlatformAPIFuncsTemplate(size+1);
117 
118 #endif
119 // 9) Global Execution System Instance
120 //PLATFORM_EXESYS_DECLARE(PLATFORM_NAME);
121 // 10) ExeSys API Functions (From Template?)
123 
console_menu.h
IMS: ccNOos, Declarations for straight C and C++
platformStart
void platformStart()
Definition: Platform_QTCreatorC.h:101
GPSPortParams
struct portParametersStruct GPSPortParams
Definition: Platform_QTCreatorC.h:62
ConsoleMenuDevDataStruct
struct devicedatastruct ConsoleMenuDevDataStruct
Definition: Platform_QTCreatorC.h:66
ExeSysAPIFuncsTemplate
#define ExeSysAPIFuncsTemplate
Definition: execution_system.h:97
platformLoopDelay
void platformLoopDelay()
Definition: Platform_QTCreatorC.h:107
execution_system.h
IMS: ccNOos, Declarations for straight C and C++
LCDKeyPadDevDataStruct
struct devicedatastruct LCDKeyPadDevDataStruct
Definition: Platform_QTCreatorC.h:65
platformSetup
void platformSetup()
Definition: Platform_QTCreatorC.h:71
createDeviceStruct
struct devicedatastruct createDeviceStruct()
Definition: io_device.c:31
devicedatastruct
the common data struct of io devices
Definition: io_device.h:62
eCompPortParams
struct portParametersStruct eCompPortParams
Definition: Platform_QTCreatorC.h:63