Skip to content

docs(display): use lv_display_delete_refr_timer to delete display timer - #5835

Merged
FASTSHIFT merged 1 commit into
lvgl:masterfrom
jakergrossman:master
Mar 12, 2024
Merged

FASTSHIFT merged 1 commit into
lvgl:masterfrom
jakergrossman:master

Conversation

@jakergrossman

@jakergrossman jakergrossman commented Mar 12, 2024 •

Copy link
Copy Markdown
Contributor

While not a valid LVGL program, the following snippet illustrates the problem with the current
example:

// main.c
#include <lvgl.h>

int main(void) {
	lv_display_t* disp = (void*)0xFEEDBEEF;

	lv_timer_delete(disp->refr_timer);
	disp->refr_timer = NULL;
}

Because lv_display_t is an opaque typedef:

../main.c: In function ‘main’:
../main.c:6:29: error: invalid use of incomplete typedef ‘lv_display_t’ {aka ‘struct _lv_display_t’}
    6 |         lv_timer_delete(disp->refr_timer);
      |                             ^~
../main.c:7:13: error: invalid use of incomplete typedef ‘lv_display_t’ {aka ‘struct _lv_display_t’}
    7 |         disp->refr_timer = NULL;
      |             ^~

@FASTSHIFT
FASTSHIFT merged commit 0a9d86d into lvgl:master Mar 12, 2024
HongChao6 pushed a commit to HongChao6/lvgl that referenced this pull request Oct 18, 2024
HongChao6 pushed a commit to HongChao6/lvgl that referenced this pull request Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants