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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
| #ifndef __UTIL_H__
| #define __UTIL_H__
|
| #include <stdbool.h>
| #include <stdint.h>
| #include <jni.h>
| #include <android/log.h>
|
| //#ifndef true
| //#define true 1
| //#endif
| //#ifndef false
| //#define false 0
| //#endif
| //#ifndef TRUE
| //#define TRUE 1
| //#endif
| //#ifndef FALSE
| //#define FALSE 0
| //#endif
|
|
| #define TRUE true
| #define FALSE false
|
| //typedef int bool;
| //typedef int BOOL;
| typedef bool BOOL;
| typedef long LONG;
| typedef unsigned long ULONG;
| typedef unsigned char BYTE;
| typedef unsigned short USHORT;
| typedef unsigned int DWORD;
|
| #define SAFE_DELETE_ARRAY(x) { if (x) free(x); x = NULL; }
|
| typedef enum
| {
| EC_UnKnow,
| EC_LibUnInit,
| EC_EnumDeviceFail,
| EC_DisableFlashWriteProtectFail,
| EC_EraseFlashFail,
| EC_EraseFlashSectorFail,
| EC_GetAsicIdFail,
| EC_GetAsicRomVersionFail,
| EC_GetAsicRomTypeFail,
| EC_ReadAsicRegisterFail,
| EC_WriteAsicRegisterFail,
| EC_UnKnowSerialFlashType,
| EC_BurnerCheckFail,
| EC_CoInitializeFail,
| EC_NoFindDevice,
| EC_MallocMemoryFail,
| }ERROR_CODE;
|
|
| typedef enum
| {
| SFT_UNKNOW,
| SFT_MXIC,
| SFT_ST,
| SFT_SST,
| SFT_ATMEL_AT25F,
| SFT_ATMEL_AT25FS,
| SFT_ATMEL_AT45DB,
| SFT_WINBOND,
| SFT_PMC,
| SFT_MXIC_LIKE ,
| SFT_AMIC,
| SFT_EON,
| SFT_ESMT,
| SFT_GIGA,
| SFT_FENTECH
| }SERIAL_FLASH_TYPE;
|
| typedef enum
| {
| DRT_Unknow,
| DRT_32K,
| DRT_64K,
| DRT_128K,
| DRT_256K
| }DSP_ROM_TYPE;
|
| #endif
|
|