forked from SZV10X_Software/SZV103_FM33A0xxEV_SiZhu

jinlicong
2024-04-18 de0f427ee76ab84d3afb22c92a2b065b1ce06d3e
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
87
#include "key.h"
 
/******************************************
 * func:    Get_key
 * desc:    scan key & return key data
 * input:   none
 * output:  none
 * return:  key data  4bytes:  
 *   4#   3#  2#   1#  byte
 * |   |KEY3|KEY2|KEY1|
 *****************************************/
uint32 Get_key(void)
{
    uint32 temp32a=0,temp32b=1;
    while(temp32a != temp32b)
    {
        temp32a = (KEY1 | (KEY2 << 8) | (KEY3 << 16));
        delay_ms(1);//È¥¶¶¶¯ 
        temp32b = (KEY1 | (KEY2 << 8) | (KEY3 << 16)); 
    }        
    return(temp32a);
}
 
 
uint32 get_key4(void)
{
    uint32 temp32a=0,temp32b=1;
    
    while(temp32a != temp32b)
    {
        temp32a = KEY4;
        delay_ms(1);//È¥¶¶¶¯ 
        temp32b = KEY4; 
    }        
    
    return(temp32a);
 
}
/******************************************
 * func:    Get_key_count
 * desc:    
 * input:   none
 * output:  none
 * return:    
 
 *****************************************/
/*
uint8_t Get_key_count(uint8_t keybufs,uint8_t key_count)
{
    uint32 key_stat=0;
    key_stat = Get_key(); //get key state
 
    if((key_stat) & 0xff)           //°´¼ü°´Ï ËÉ¿ªÖ®ºó²ÅÄÜÉúЧÏÂÒ»´Î°´¼ü
    {
        if( !keybufs )
        {
            keybufs  = 0x01;
        }
    }
    else
    {
        if( keybufs )
        {
            keybufs  = 0x00;
            key_count++;
            if(key_count==11)
            {
               key_count = 0;
            }
        }
    }
    return key_count;
 
}      */
void key_interruptinit_disable(void)
{
}
 
void key_interruptinit_enable(void)
{
 
}
 
void key_interruptinit(void)  
{  
 
}