2022-10-20 03:36 AM
Hello,
I am going crazy, I always get the error that the structure Lcd_Ctx is not declared, while it is clearly declared (by including "stm32h750b_discovery_lcd.h").
With F3 I can find the structure declaration.
If I change the file from .c to .cpp the error is gone...
See screenshot below:
Solved! Go to Solution.
2022-10-21 05:27 AM
oh, now I see the problem, thank you.
In the 745 h-file the variable is declared with extern Lcd_Ctx, and in the 750 h-file with LcdCtx ...
2022-10-20 07:25 AM
Sorry , but you dont show where you declare Lcd_Ctx not type , but object. Try show code part.
2022-10-20 07:36 AM
here:
2022-10-20 08:05 AM
There should be a .h file with an "extern" declaration for that variable (maybe in stm32h750b_discovery_lcd.h). Make sure that you include that file in your lvgl_port_lcd.c file. If there isn't an "extern" declaration somewhere, you need to add one.
2022-10-21 02:07 AM
In following code there is no "extern" declaration, see link/screenshot below.
I just copied the files into my code, and if possible I don't want change something in these files.
Why do I need it in my code this "extern" but in the mentioned/linked code there is no "extern" declaration? How can I do it the same way?
2022-10-21 03:00 AM
Hello, I think that it finds your structure but not your variable, in the file where you want to use your variable you must write extern BSP_LCD_Ctx_t Lcd_Ctx[LCD_INSTANCES_NBR] because the variable is not declare in the same file.
2022-10-21 03:29 AM
2022-10-21 04:35 AM
yes, my C-basic knowledge will have gaps for sure... but the thing with these links I never really understood, or never found something that explains this understandable, so my devise is "learning by doing"...
I still not understand the difference between my file structure and the file structure of the origin code on github... and why the code on github does not need this "extern" declaration...
2022-10-21 04:36 AM
.
2022-10-21 05:19 AM
/** @addtogroup STM32H745I_DISCO_LCD_Exported_Variables
* @{
*/
extern const LCD_UTILS_Drv_t LCD_Driver;
extern DMA2D_HandleTypeDef hlcd_dma2d;
extern LTDC_HandleTypeDef hlcd_ltdc;
extern BSP_LCD_Ctx_t Lcd_Ctx[];