OS  v1.7.5
Documentation
Loading...
Searching...
No Matches
types.hpp
1#ifndef QOS_CPP_TYPES
2#define QOS_CPP_TYPES
3
4#if defined( ARDUINO ) || defined( ARDUINO_ARCH_AVR) || defined( ARDUINO_ARCH_SAMD ) || defined( ENERGIA_ARCH_MSP430ELF )
5 #define ARDUINO_PLATFORM
6#endif
7
8#if ( __cplusplus < 201103L || defined ( __AVR_ARCH__ ) || defined( ARDUINO_PLATFORM ) || defined ( STM8Sxx ) )
9 #include <stddef.h>
10 #include <stdint.h>
11 #include <stdlib.h>
12 #include <string.h>
13 #include <ctype.h>
14 #include <limits.h>
15 #define STD_TYPE_UINT8_T uint8_t
16 #define STD_TYPE_UINT16_T uint16_t
17 #define STD_TYPE_UINT32_T uint32_t
18 #define STD_TYPE_INT8_T int8_t
19 #define STD_TYPE_INT16_T int16_t
20 #define STD_TYPE_INT32_T int32_t
21 #define STD_TYPE_UINTPTR_T uintptr_t
22 #define STD_TYPE_SIZE_T size_t
23#else
24 #include <cstddef>
25 #include <cstdint>
26 #include <cstdlib>
27 #include <cstring>
28 #include <cctype>
29 #include <climits>
30 #define STD_TYPE_UINT8_T std::uint8_t
31 #define STD_TYPE_UINT16_T std::uint16_t
32 #define STD_TYPE_UINT32_T std::uint32_t
33 #define STD_TYPE_INT8_T std::int8_t
34 #define STD_TYPE_INT16_T std::int16_t
35 #define STD_TYPE_INT32_T std::int32_t
36 #define STD_TYPE_UINTPTR_T std::uintptr_t
37 #define STD_TYPE_SIZE_T std::size_t
38#endif
39
40#if defined( ARDUINO_PLATFORM )
41 #include <Arduino.h>
42#else
43 #include <string>
44#endif
45
46#ifndef SIZE_MAX
47 #define SIZE_MAX ( ~static_cast<size_t>( 0 ) )
48#endif
49
50namespace qOS {
62 using base_t = int;
63
67 using byte_t = STD_TYPE_UINT8_T;
68
72 using unsigned_t = unsigned long;
73
77 using signed_t = long int;
78
82 using float32_t = float; /*this is not always true in some compilers*/
83
87 using float64_t = double; /*this is not always true in some compilers*/
88
94 using index_t = STD_TYPE_SIZE_T;
95
99 using cycles_t = STD_TYPE_UINT32_T;
100
104 using iteration_t = STD_TYPE_INT32_T;
105
109 using priority_t = STD_TYPE_UINT8_T;
110
112 using uint8_t = STD_TYPE_UINT8_T;
113 using uint16_t = STD_TYPE_UINT16_T;
114 using uint32_t = STD_TYPE_UINT32_T;
115 using int8_t = STD_TYPE_INT8_T;
116 using int16_t = STD_TYPE_INT16_T;
117 using int32_t = STD_TYPE_INT32_T;
118 using uintptr_t = STD_TYPE_UINTPTR_T;
119 using size_t = STD_TYPE_SIZE_T;
120 #if defined( ARDUINO_PLATFORM )
121 using string = String;
122 #else
123 using string = std::string;
124 #endif
130 using timeCount_t = unsigned long;
131
133}
134
136#define Q_UNUSED(arg) (void)(arg)
137#define Q_NONE /*EMPTY MACRO*/
140#endif /*QOS_CPP_TYPES*/
unsigned long timeCount_t
A type to instantiate a variable to hold a time count.
Definition types.hpp:130
STD_TYPE_SIZE_T index_t
A type to instantiate an OS index variable. Can store the maximum size of a theoretically possible ob...
Definition types.hpp:94
int base_t
A type to instantiate a integer-base variable. This size of this type is implementation-defined.
Definition types.hpp:62
float float32_t
A type to instantiate a single-precision variable of 32-bits IEEE 754.
Definition types.hpp:82
STD_TYPE_INT32_T iteration_t
A type to instantiate a variable that hold the number of task iterations.
Definition types.hpp:104
STD_TYPE_UINT8_T byte_t
A type to instantiate a byte variable.
Definition types.hpp:67
STD_TYPE_UINT32_T cycles_t
A type to instantiate a variable that hold the number of task cycles.
Definition types.hpp:99
unsigned long unsigned_t
A type to instantiate an unsigned variable.
Definition types.hpp:72
long int signed_t
A type to instantiate an signed variable.
Definition types.hpp:77
double float64_t
A type to instantiate a single-precision variable of 64-bits IEEE 754.
Definition types.hpp:87
STD_TYPE_UINT8_T priority_t
A type to instantiate a variable to hold the priority value of a task.
Definition types.hpp:109
OS/Kernel interfaces.
Definition bytebuffer.hpp:7