Hi everyone 👋
I’m using lv_port_pc_visual_studio
as a submodule in my own project.
I want to:
Run my own UI code inside the simulator
Avoid modifying the original simulator source code (main.c etc.)
Reuse the same UI code on both Windows simulator and embedded hardware
My current structure looks like this:
MyProject/
├─ lv_port_pc_visual_studio/ # submodule (original)
├─ src/
│ ├─ ui_app.c
│ └─ ui_app.h
└─ main_x86.c # my own entry for simulator
└─ CMakeLists.txt
I’m planning to:
Write my own main_pc.c to initialize LVGL and call ui_app_init()
Keep the submodule untouched
Add main_x86.c and ui_app.c to the build system (Visual Studio)
Is this the recommended approach?
Or is there a cleaner/more “LVGL style” way to hook my code into the simulator startup?
Thanks a lot 🙏
Environment:
OS: Windows
Compiler: Visual Studio 2022
Simulator: lv_port_pc_visual_studio submodule