image/svg+xml
Brteve's API for EveApps
Version 0.0.1
The reference document for common folder of EveApps project.
 
Loading...
Searching...
No Matches
EVE_Platform.h
Go to the documentation of this file.
1
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36#ifndef EVE_PLATFORM__H
37#define EVE_PLATFORM__H
38
39/* Include all public headers. */
40#include "EVE_Config.h"
41#if defined(_WIN32)
42#include "EVE_Platform_WIN32.h"
43#endif
44#if defined(BT8XXEMU_PLATFORM)
46#endif
47#if defined(FT4222_PLATFORM)
48#include "EVE_Platform_FT4222.h"
49#endif
50#if defined(MPSSE_PLATFORM)
51#include "EVE_Platform_MPSSE.h"
52#endif
53#if defined(FT9XX_PLATFORM)
54#include "EVE_Platform_FT9XX.h"
55#endif
56#if defined(RP2040_PLATFORM)
57#include "EVE_Platform_RP2040.h"
58#endif
59#include "EVE_GpuTypes.h"
60#include "EVE_HalDefs.h"
61#include "EVE_Cmd.h"
62#include "EVE_MediaFifo.h"
63#include "EVE_CoCmd.h"
64#include "EVE_CoDl.h"
65#include "EVE_GpuDefs.h"
66#if defined(ENABLE_ILI9488_HVGA_PORTRAIT) || defined(ENABLE_KD2401_HVGA_PORTRAIT)
67#include "EVE_ILI9488.h"
68#endif
69#include "EVE_Util.h"
70#include "EVE_LoadFile.h"
71
72#define eve_noop() \
73 do \
74 { \
75 } while (false)
76
77#ifdef EVE_DEBUG_BREAK_SIGABRT
78/* Used by LittleFS tests */
79#include <signal.h>
80#define eve_debug_break() \
81 do \
82 { \
83 fflush(NULL); \
84 raise(SIGABRT); \
85 } while (false)
86#else
87#if defined(_DEBUG)
88#if defined(_MSC_VER)
89#define eve_debug_break() __debugbreak()
90#elif defined(__GCC__)
91#define eve_debug_break() __builtin_trap()
92#else
93#define eve_debug_break() eve_noop()
94#endif
95#else
96#define eve_debug_break() eve_noop()
97#endif
98#endif
99
100#if defined(__GNUC__) || defined(__clang__)
101#define eve_deprecated(msg) __attribute__((deprecated(msg)))
102#elif defined(_MSC_VER)
103#define eve_deprecated(msg) __declspec(deprecated(msg))
104#elif (__cplusplus >= 201402L)
105#define eve_deprecated(msg) [[deprecated(msg)]]
106#else
107#define eve_deprecated(msg)
108#endif
109
110#ifndef eve_printf
111#define eve_printf(fmt, ...) printf(fmt, ##__VA_ARGS__)
112#endif
113
114#ifndef eve_sprintf
115#define eve_sprintf(str, fmt, ...) sprintf(str, fmt, ##__VA_ARGS__)
116#endif
117
118#if defined(_MSC_VER) && !defined(__clang__)
119#define eve_assume(cond) __assume(cond)
120#else
121#define eve_assume(cond) eve_noop()
122#endif
123
124#if defined(_DEBUG)
125#define eve_printf_debug_once(fmt, ...) \
126 do \
127 { \
128 static bool eve_printf_debug_once_flag = false; \
129 if (!eve_printf_debug_once_flag) \
130 { \
131 eve_printf(fmt, ##__VA_ARGS__); \
132 eve_printf_debug_once_flag = true; \
133 } \
134 } while (false)
135#define eve_printf_debug(fmt, ...) eve_printf(fmt, ##__VA_ARGS__)
136#define eve_assert(cond) \
137 do \
138 { \
139 if (!(cond)) \
140 { \
141 const char *str = #cond; \
142 const char *sf = __FILE__; \
143 eve_printf("EVE Assert Failed: %s (in file '%s' on line '%i')\n", str ? str : "<NULL>", sf ? sf : "<NULL>", __LINE__); \
144 eve_debug_break(); \
145 } \
146 eve_assume(cond); \
147 } while (false)
148#define eve_assert_ex(cond, ex) \
149 do \
150 { \
151 if (!(cond)) \
152 { \
153 const char *str = #cond; \
154 const char *sf = __FILE__; \
155 eve_printf("EVE Assert Failed: %s (%s) (in file '%s' on line '%i')\n", ex ? ex : "<NULL>", str ? str : "<NULL>", sf ? sf : "<NULL>", __LINE__); \
156 eve_debug_break(); \
157 } \
158 eve_assume(cond); \
159 } while (false)
160#define eve_assert_do(cond) eve_assert(cond)
161#define eve_trace(str) \
162 do \
163 { \
164 const char *sc = __FILE__; \
165 eve_printf("EVE Trace: %s (in file '%s' on line '%i')\n", (str) ? (str) : "<NULL>", sf ? sf : "<NULL>", __LINE__); \
166 } while (false)
167#else
168#define eve_printf_debug_once(fmt, ...) eve_noop()
169#define eve_printf_debug(fmt, ...) eve_noop()
170#define eve_assert(cond) eve_assume(cond)
171#define eve_assert_ex(cond, ex) eve_assume(cond)
172#define eve_assert_do(cond) \
173 do \
174 { \
175 bool r__assert = (cond); \
176 r__assert = r__assert; \
177 eve_assume(r__assert); \
178 } while (false)
179#define eve_trace(cond) eve_noop()
180#endif
181
182#ifndef NOMINMAX
183#ifndef max
184#define max(a, b) (((a) > (b)) ? (a) : (b))
185#endif
186#ifndef min
187#define min(a, b) (((a) < (b)) ? (a) : (b))
188#endif
189#endif
190
191/* Custom scope keyword (to avoid tripping the auto-formatter on scopes) */
192#ifndef eve_scope
193#define eve_scope() if (true)
194#endif
195
196#endif /* #ifndef EVE_PLATFORM__H */
197
198#ifdef __cplusplus
199}
200#endif
201
202/* end of file */
EVE's command read/write.
EVE's co-processor commmands.
EVE's co-processor command.
This file processes the input definitions.
Defines EVE hardware values.
Defines EVE hardware values.
Eve_Hal framework APIs.
ILI9488 driver source.
Eve_Hal framework APIs for loading file.
EVE's mediafifo controller.
EVE platform for EMULATOR.
EVE platform for FT4222.
EVE platform for FT9XX.
EVE platform for MPSSE.
Eve_Hal framework APIs for RP2040 host platform.
EVE platform for WIN32.
EVE HAL framework utilities.