mirror of
https://github.com/lvgl/lvgl.git
synced 2024-11-23 17:53:45 +08:00
docs(porting) fix indev example to remove v7 bool return (#2381)
update indev doc example to remove v7 `return false` and fix return type
This commit is contained in:
parent
c386110e23
commit
5a3876e9e6
@ -123,7 +123,7 @@ indev_drv.read_cb = encoder_with_keys_read;
|
||||
|
||||
...
|
||||
|
||||
bool encoder_with_keys_read(lv_indev_drv_t * drv, lv_indev_data_t*data){
|
||||
void encoder_with_keys_read(lv_indev_drv_t * drv, lv_indev_data_t*data){
|
||||
data->key = last_key(); /*Get the last pressed or released key*/
|
||||
/* use LV_KEY_ENTER for encoder press */
|
||||
if(key_pressed()) data->state = LV_INDEV_STATE_PRESSED;
|
||||
@ -132,8 +132,6 @@ bool encoder_with_keys_read(lv_indev_drv_t * drv, lv_indev_data_t*data){
|
||||
/* Optionally you can also use enc_diff, if you have encoder*/
|
||||
data->enc_diff = enc_get_new_moves();
|
||||
}
|
||||
|
||||
return false; /*No buffering now so no more data read*/
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user