Go to the documentation of this file.
33 #include "os_port_config.h"
40 #define timeCompare(t1, t2) ((int32_t) ((t1) - (t2)))
43 #if !defined(__AT32F403A_407_LIBRARY_VERSION) && \
44 !defined(__AT32F435_437_LIBRARY_VERSION)
55 #define LSB(x) ((x) & 0xFF)
59 #define MSB(x) (((x) >> 8) & 0xFF)
63 #define MIN(a, b) ((a) < (b) ? (a) : (b))
67 #define MAX(a, b) ((a) > (b) ? (a) : (b))
71 #define arraysize(a) (sizeof(a) / sizeof(a[0]))
75 #define INFINITE_DELAY ((uint_t) -1)
77 #define MAX_DELAY (INFINITE_DELAY / 2)
80 #if defined(USE_NO_RTOS)
83 #elif defined(USE_CHIBIOS)
86 #elif defined(USE_CMX_RTX)
89 #elif defined(USE_CMSIS_RTOS)
92 #elif defined(USE_CMSIS_RTOS2)
95 #elif defined(USE_FREERTOS)
98 #elif defined(USE_SAFERTOS)
101 #elif defined(USE_THREADX)
104 #elif defined(USE_RTX)
107 #elif defined(USE_UCOS2)
110 #elif defined(USE_UCOS3)
113 #elif defined(USE_PX5)
116 #elif defined(USE_EMBOS)
119 #elif defined(USE_SYS_BIOS)
122 #elif defined(USE_ZEPHYR)
125 #elif defined(_WIN32)
128 #elif defined(__linux__) || defined(__FreeBSD__)
135 #define osMemset(p, value, length) (void) memset(p, value, length)
141 #define osMemcpy(dest, src, length) (void) memcpy(dest, src, length)
147 #define osMemmove(dest, src, length) (void) memmove(dest, src, length)
153 #define osMemcmp(p1, p2, length) memcmp(p1, p2, length)
159 #define osMemchr(p, c, length) memchr(p, c, length)
165 #define osStrlen(s) strlen(s)
171 #define osStrcmp(s1, s2) strcmp(s1, s2)
177 #define osStrncmp(s1, s2, length) strncmp(s1, s2, length)
183 #define osStrcasecmp(s1, s2) strcasecmp(s1, s2)
187 #ifndef osStrncasecmp
189 #define osStrncasecmp(s1, s2, length) strncasecmp(s1, s2, length)
195 #define osStrchr(s, c) strchr(s, c)
201 #define osStrstr(s1, s2) strstr(s1, s2)
207 #define osStrcpy(s1, s2) (void) strcpy(s1, s2)
213 #define osStrncpy(s1, s2, length) (void) strncpy(s1, s2, length)
219 #define osStrcat(s1, s2) (void) strcat(s1, s2)
225 #define osStrtok_r(s, delim, last) strtok_r(s, delim, last)
231 #define osSprintf(dest, ...) sprintf(dest, __VA_ARGS__)
237 #define osSnprintf(dest, size, ...) snprintf(dest, size, __VA_ARGS__)
243 #define osVsnprintf(dest, size, format, ap) vsnprintf(dest, size, format, ap)
249 #define osAtoi(s) atoi(s)
255 #define osStrtoul(s, endptr, base) strtoul(s, endptr, base)
261 #define osStrtoull(s, endptr, base) strtoull(s, endptr, base)
267 #define osTolower(c) tolower((uint8_t) (c))
273 #define osToupper(c) toupper((uint8_t) (c))
279 #define osIsupper(c) isupper((uint8_t) (c))
285 #define osIsdigit(c) isdigit((uint8_t) (c))
291 #define osIsspace(c) isspace((uint8_t) (c))
296 #define osIsblank(c) ((c) == ' ' || (c) == '\t')
299 #if !defined(__linux__) && !defined(__FreeBSD__)
303 #define usleep(delay) {volatile uint32_t n = delay * 4; while(n > 0) n--;}
307 #define sleep(delay) {volatile uint32_t n = delay * 4000; while(n > 0) n--;}
315 #define OS_INVALID_HANDLE OS_INVALID_TASK_ID
RTOS abstraction layer (CMSIS-RTOS)
RTOS abstraction layer (ChibiOS/RT)
RTOS abstraction layer (Keil RTX)
RTOS abstraction layer (CMSIS-RTOS 2 / RTX v5)
RTOS abstraction layer (Micrium uC/OS-II)
RTOS abstraction layer (Eclipse ThreadX)
RTOS abstraction layer (SYS/BIOS)
RTOS abstraction layer (SafeRTOS)
RTOS abstraction layer (FreeRTOS)
RTOS abstraction layer (PX5)
RTOS abstraction layer (Zephyr)
RTOS abstraction layer (Windows)
RTOS abstraction layer (POSIX Threads)
RTOS abstraction layer (Micrium uC/OS-III)
RTOS abstraction layer (CMX-RTX)
Compiler specific definitions.
RTOS abstraction layer (Segger embOS)