Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #pragma once
00036
00037
00038 #ifdef _WIN32
00039
00040
00041
00042 typedef signed char int8_t;
00043 typedef unsigned char uint8_t;
00044
00045 typedef __int16 int16_t;
00046 typedef unsigned __int16 uint16_t;
00047
00048 typedef __int32 int32_t;
00049 typedef unsigned __int32 uint32_t;
00050
00051 typedef __int64 int64_t;
00052 typedef unsigned __int64 uint64_t;
00053
00054 #else
00055
00056 #include <stdint.h>
00057
00058 #endif
00059
00060
00061
00062 typedef int8_t _s8;
00063 typedef uint8_t _u8;
00064
00065 typedef int16_t _s16;
00066 typedef uint16_t _u16;
00067
00068 typedef int32_t _s32;
00069 typedef uint32_t _u32;
00070
00071 typedef int64_t _s64;
00072 typedef uint64_t _u64;
00073
00074 #define __small_endian
00075
00076 #ifndef __GNUC__
00077 #define __attribute__(x)
00078 #endif
00079
00080
00081
00082 #ifdef _AVR_
00083 typedef _u8 _word_size_t;
00084 #define THREAD_PROC
00085 #elif defined (WIN64)
00086 typedef _u64 _word_size_t;
00087 #define THREAD_PROC __stdcall
00088 #elif defined (WIN32)
00089 typedef _u32 _word_size_t;
00090 #define THREAD_PROC __stdcall
00091 #elif defined (__GNUC__)
00092 typedef unsigned long _word_size_t;
00093 #define THREAD_PROC
00094 #elif defined (__ICCARM__)
00095 typedef _u32 _word_size_t;
00096 #define THREAD_PROC
00097 #endif
00098
00099
00100 typedef uint32_t u_result;
00101
00102 #define RESULT_OK 0
00103 #define RESULT_FAIL_BIT 0x80000000
00104 #define RESULT_ALREADY_DONE 0x20
00105 #define RESULT_INVALID_DATA (0x8000 | RESULT_FAIL_BIT)
00106 #define RESULT_OPERATION_FAIL (0x8001 | RESULT_FAIL_BIT)
00107 #define RESULT_OPERATION_TIMEOUT (0x8002 | RESULT_FAIL_BIT)
00108 #define RESULT_OPERATION_STOP (0x8003 | RESULT_FAIL_BIT)
00109 #define RESULT_OPERATION_NOT_SUPPORT (0x8004 | RESULT_FAIL_BIT)
00110 #define RESULT_FORMAT_NOT_SUPPORT (0x8005 | RESULT_FAIL_BIT)
00111 #define RESULT_INSUFFICIENT_MEMORY (0x8006 | RESULT_FAIL_BIT)
00112
00113 #define IS_OK(x) ( ((x) & RESULT_FAIL_BIT) == 0 )
00114 #define IS_FAIL(x) ( ((x) & RESULT_FAIL_BIT) )
00115
00116 typedef _word_size_t (THREAD_PROC * thread_proc_t ) ( void * );