diff --git a/README.md b/README.md index 1695ef0..f8535b8 100644 --- a/README.md +++ b/README.md @@ -215,7 +215,7 @@ while (1) } ``` -具体可以参考`example_win32.c`和`test.c`的实现。 +具体可以参考`example_user.c`和`example_test.c`的实现。 @@ -659,7 +659,7 @@ int ebtn_is_in_process(void); 而当按下保持时间大于`time_click_pressed_max`时,就不会上报`ONCLICK`事件,如下图所示。 -![image-20240223145802203](https://markdown-1306347444.cos.ap-shanghai.myqcloud.com/img/image-20240223145802203.png) +![image-20240227112945641](https://markdown-1306347444.cos.ap-shanghai.myqcloud.com/img/image-20240227112945641.png) diff --git a/README.vsdx b/README.vsdx index e3c6740..e056d70 100644 Binary files a/README.vsdx and b/README.vsdx differ diff --git a/ebtn/ebtn.c b/ebtn/ebtn.c index 302d2a0..988e8b9 100644 --- a/ebtn/ebtn.c +++ b/ebtn/ebtn.c @@ -62,14 +62,14 @@ static void prv_process_btn(ebtn_btn_t *btn, uint8_t old_state, uint8_t new_stat btn->click_cnt = 0; } - /* Start with new on-press */ - btn->flags |= EBTN_FLAG_ONPRESS_SENT; - ebtobj->evt_fn(btn, EBTN_EVT_ONPRESS); - /* Set keep alive time */ btn->keepalive_last_time = mstime; btn->keepalive_cnt = 0; + /* Start with new on-press */ + btn->flags |= EBTN_FLAG_ONPRESS_SENT; + ebtobj->evt_fn(btn, EBTN_EVT_ONPRESS); + btn->time_change = mstime; /* Button state has now changed */ } }