New Feature:Add keys untreated counter
This commit is contained in:
parent
203f233923
commit
dab8f76f3f
13
xcmd/xcmd.c
13
xcmd/xcmd.c
|
@ -60,7 +60,16 @@ static void xcmd_key_match(xcmder_t *cmder, XCMD_KEY_T key)
|
|||
{
|
||||
if(p->key == key)
|
||||
{
|
||||
p->func(cmder);
|
||||
if(p->func(cmder) < 0)
|
||||
{
|
||||
cmder->key_list.untreated.key = key;
|
||||
cmder->key_list.untreated.count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
cmder->key_list.untreated.key = 0;
|
||||
cmder->key_list.untreated.count = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
p = p->next;
|
||||
|
@ -476,6 +485,8 @@ xcmder_t *xcmd_create( int (*get_c)(uint8_t*), int (*put_c)(uint8_t), uint16_t c
|
|||
|
||||
cmder->cmd_list.len = 0;
|
||||
cmder->cmd_list.next = NULL;
|
||||
cmder->key_list.untreated.key = 0;
|
||||
cmder->key_list.untreated.count = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -103,6 +103,11 @@ typedef struct
|
|||
{
|
||||
uint16_t len;
|
||||
xcmd_key_t *next;
|
||||
struct
|
||||
{
|
||||
XCMD_KEY_T key;
|
||||
uint16_t count;
|
||||
}untreated;
|
||||
|
||||
}key_list;
|
||||
|
||||
|
|
Loading…
Reference in New Issue