mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
fix(docs) add static keyword to driver declaration (#2452)
Add missing static keyword to disp_drv and indev_drv declarations in the examples
This commit is contained in:
parent
e41c507804
commit
e8c1670381
@ -35,7 +35,7 @@ lv_disp_draw_buf_init(&draw_buf, buf1, NULL, MY_DISP_HOR_RES * MY_DISP_VER_SER /
|
||||
```
|
||||
- Implement and register a function which can copy the rendered image to an area of your display:
|
||||
```c
|
||||
lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/
|
||||
static lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/
|
||||
lv_disp_drv_init(&disp_drv); /*Basic initialization*/
|
||||
disp_drv.flush_cb = my_disp_flush; /*Set your driver function*/
|
||||
disp_drv.buffer = &draw_buf; /*Assign the buffer to the display*/
|
||||
@ -61,7 +61,7 @@ void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * co
|
||||
```
|
||||
- Implement and register a function which can read an input device. E.g. for a touch pad:
|
||||
```c
|
||||
lv_indev_drv_t indev_drv; /*Descriptor of a input device driver*/
|
||||
static lv_indev_drv_t indev_drv; /*Descriptor of a input device driver*/
|
||||
lv_indev_drv_init(&indev_drv); /*Basic initialization*/
|
||||
indev_drv.type = LV_INDEV_TYPE_POINTER; /*Touch pad is a pointer-like device*/
|
||||
indev_drv.read_cb = my_touchpad_read; /*Set your driver function*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user