LVGL 使用过程中 static 变量问题

Moderator: ESP_Bob

another_esp_user
Posts: 13
Joined: Tue Oct 05, 2021 2:53 am

LVGL 使用过程中 static 变量问题

Postby another_esp_user » Fri Dec 10, 2021 9:56 am

display.c
(3.09 KiB) Downloaded 767 times
这份代码中我声明了一个全局static 函数指针static FP_MENU_PANEL current_menu_panel;,我仅仅在init_menu对这个指针做过一次赋值,指向此文件包含的一个头文件中的函数main_menu_panel,之后就没有修改它了,但是我在日志中输出这个指针的值时发现它一直在变动,系统有警告日志,指向lvgl的一个文件,请问这个是怎么回事?我是新手,有点不理解。
微信图片_20211210173404.png
微信图片_20211210173404.png (110 KiB) Viewed 9285 times

another_esp_user
Posts: 13
Joined: Tue Oct 05, 2021 2:53 am

Re: LVGL 使用过程中 static 变量问题

Postby another_esp_user » Sat Dec 11, 2021 1:24 am

我今天在display.c里加了这个:
static void main_menu_panel_proc(int8_t panel_act,int8_t item_act){
main_menu_panel(panel_act,item_act);
}

然后把指针指向它,地址就不变了...请问这个是什么原因?

Who is online

Users browsing this forum: No registered users and 26 guests