| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
#pragma once |
| 36 |
|
| 37 |
|
| 38 |
#ifdef _WIN32 |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
typedef signed char int8_t; |
| 43 |
typedef unsigned char uint8_t; |
| 44 |
|
| 45 |
typedef __int16 int16_t; |
| 46 |
typedef unsigned __int16 uint16_t; |
| 47 |
|
| 48 |
typedef __int32 int32_t; |
| 49 |
typedef unsigned __int32 uint32_t; |
| 50 |
|
| 51 |
typedef __int64 int64_t; |
| 52 |
typedef unsigned __int64 uint64_t; |
| 53 |
|
| 54 |
#else |
| 55 |
|
| 56 |
#include <stdint.h> |
| 57 |
|
| 58 |
#endif |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
typedef int8_t _s8; |
| 63 |
typedef uint8_t _u8; |
| 64 |
|
| 65 |
typedef int16_t _s16; |
| 66 |
typedef uint16_t _u16; |
| 67 |
|
| 68 |
typedef int32_t _s32; |
| 69 |
typedef uint32_t _u32; |
| 70 |
|
| 71 |
typedef int64_t _s64; |
| 72 |
typedef uint64_t _u64; |
| 73 |
|
| 74 |
#define __small_endian |
| 75 |
|
| 76 |
#ifndef __GNUC__ |
| 77 |
#define __attribute__(x) |
| 78 |
#endif |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
#ifdef _AVR_ |
| 83 |
typedef _u8 _word_size_t; |
| 84 |
#define THREAD_PROC |
| 85 |
#elif defined (WIN64) |
| 86 |
typedef _u64 _word_size_t; |
| 87 |
#define THREAD_PROC __stdcall |
| 88 |
#elif defined (WIN32) |
| 89 |
typedef _u32 _word_size_t; |
| 90 |
#define THREAD_PROC __stdcall |
| 91 |
#elif defined (__GNUC__) |
| 92 |
typedef unsigned long _word_size_t; |
| 93 |
#define THREAD_PROC |
| 94 |
#elif defined (__ICCARM__) |
| 95 |
typedef _u32 _word_size_t; |
| 96 |
#define THREAD_PROC |
| 97 |
#endif |
| 98 |
|
| 99 |
|
| 100 |
typedef uint32_t u_result; |
| 101 |
|
| 102 |
#define RESULT_OK 0 |
| 103 |
#define RESULT_FAIL_BIT 0x80000000 |
| 104 |
#define RESULT_ALREADY_DONE 0x20 |
| 105 |
#define RESULT_INVALID_DATA (0x8000 | RESULT_FAIL_BIT) |
| 106 |
#define RESULT_OPERATION_FAIL (0x8001 | RESULT_FAIL_BIT) |
| 107 |
#define RESULT_OPERATION_TIMEOUT (0x8002 | RESULT_FAIL_BIT) |
| 108 |
#define RESULT_OPERATION_STOP (0x8003 | RESULT_FAIL_BIT) |
| 109 |
#define RESULT_OPERATION_NOT_SUPPORT (0x8004 | RESULT_FAIL_BIT) |
| 110 |
#define RESULT_FORMAT_NOT_SUPPORT (0x8005 | RESULT_FAIL_BIT) |
| 111 |
#define RESULT_INSUFFICIENT_MEMORY (0x8006 | RESULT_FAIL_BIT) |
| 112 |
|
| 113 |
#define IS_OK(x) ( ((x) & RESULT_FAIL_BIT) == 0 ) |
| 114 |
#define IS_FAIL(x) ( ((x) & RESULT_FAIL_BIT) ) |
| 115 |
|
| 116 |
typedef _word_size_t (THREAD_PROC * thread_proc_t ) ( void * ); |