Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
is_btn_down_func will return MFBD_BTN_STATE_UP or others.
  • Loading branch information
smartmx committed Mar 26, 2023
1 parent 4ec2e3c commit 31c1ef8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions examples/mfbd_demo_rtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,31 +137,31 @@ unsigned char bsp_btn_check(mfbd_btn_index_t btn_index)
case 1:
if (rt_pin_read(BTN_KEY0) == 0)
{
return 1;
return MFBD_BTN_STATE_DOWN;
}
break;
case 2:
if (rt_pin_read(BTN_KEY1) == 0)
{
return 1;
return MFBD_BTN_STATE_DOWN;
}
break;
case 3:
if (rt_pin_read(BTN_KEY2) == 0)
{
return 1;
return MFBD_BTN_STATE_DOWN;
}
break;
case 4:
if (rt_pin_read(BTN_WK_UP) == 1)
{
return 1;
return MFBD_BTN_STATE_DOWN;
}
break;
default:
break;
}
return 0;
return MFBD_BTN_STATE_UP;
}

void bsp_btn_value_report(mfbd_btn_code_t btn_value)
Expand Down
6 changes: 3 additions & 3 deletions mfbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void mfbd_tbtn_scan(const mfbd_group_t *_pbtn_group)

while (_pbtn != NULL)
{
if (_pbtn_group->is_btn_down_func(_pbtn->btn_info->btn_index) != 0)
if (_pbtn_group->is_btn_down_func(_pbtn->btn_info->btn_index) != MFBD_BTN_STATE_UP)
{
if (_pbtn->filter_count < (MFBD_FILTER_TIME_IN_FUC))
{
Expand Down Expand Up @@ -144,7 +144,7 @@ void mfbd_nbtn_scan(const mfbd_group_t *_pbtn_group)

while (_pbtn != NULL)
{
if (_pbtn_group->is_btn_down_func(_pbtn->btn_info->btn_index) != 0)
if (_pbtn_group->is_btn_down_func(_pbtn->btn_info->btn_index) != MFBD_BTN_STATE_UP)
{
if (_pbtn->filter_count < (MFBD_FILTER_TIME_IN_FUC))
{
Expand Down Expand Up @@ -267,7 +267,7 @@ void mfbd_mbtn_scan(const mfbd_group_t *_pbtn_group)
mfbd_mbtn_t *_pbtn = *_ppbtn;
while (_pbtn != NULL)
{
if (_pbtn_group->is_btn_down_func(_pbtn->btn_info->btn_index) != 0)
if (_pbtn_group->is_btn_down_func(_pbtn->btn_info->btn_index) != MFBD_BTN_STATE_UP)
{
if (_pbtn->filter_count < (MFBD_FILTER_TIME_IN_FUC))
{
Expand Down

0 comments on commit 31c1ef8

Please sign in to comment.