forked from SZV10X_Software/SZV103_FM33A0xxEV_SiZhu

jinlicong
2024-04-19 d91ac630ac0e13ea31919052ea2bc54cafef583b
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
#include "system_general_para.h"
 
//uint8_t read_data_buf_A_l[200] ={0};
//uint8_t read_data_buf_B_l[200] ={0};
//uint8_t read_data_buf_C_l[200] ={0};
 
__IO FlagStatus sys_run_period; // ÏµÍ³¼¤»îÖÜÆÚ
 
 
/*******************³£ÓõĴúÂ빤¾ß********************************/
/******************************************
 * func: ucharcmp
 * desc: Á½×éÊý¾Ý±È½Ï£¬²»Ïàͬ·µ»ØFAIL,Ïàͬ·µ»ØPASS
 * input: none
 * output: none
 * return: none
 *****************************************/
ErrorStatus  ucharcmp(uint8_t *dataA,uint8_t *dataB,u16 data_length)
{
    u16 index_i=0;
    ErrorStatus return_flag=FAIL;
    for(index_i=0;index_i<data_length;index_i++)
    {
        if((*(dataA + index_i))!=(*(dataB + index_i)) )        
        {
            return_flag = FAIL;
            break;
        }else
        {
            
        }
                
    }
    
    if(index_i ==data_length)
    {
        return_flag = PASS;
    }
    
    return  return_flag;
}
 
 
 
/******************************************
 * func: arrayA_2_arrayB
 * desc: array A TO array B
 * input: none
 * output: none
 * return: none
 *****************************************/
void arrayA_2_arrayB(uint8_t * aA , uint8_t * aB, u16 len, BIG_OR_LITTLE_ENDIAN mode)  
{
    u16 index;
    uint8_t *ptra,*ptrb;
    
    if(mode==LITTLE_ENDIAN)
    {
        ptra = aA;
        ptrb = aB;
        for(index = 0; index < len; index ++)
        {
            *ptrb = *ptra;
            ptrb ++;
            ptra ++;
        }    
    }else if(mode==BIG_ENDIAN)
    {
        ptra = aA + len - 1;
        ptrb = aB;
        for(index = 0; index < len; index ++)
        {
            *ptrb = *ptra;
            ptrb ++;
            ptra --;
        }    
        
    }
}