Skip to content

Comments

[Build Issue] Replace 0 literal with LV_PART_MAIN#70

Merged
daniloc merged 2 commits intoPostHog:mainfrom
copperwall:fix-build-issue-with-question-card
Dec 15, 2025
Merged

[Build Issue] Replace 0 literal with LV_PART_MAIN#70
daniloc merged 2 commits intoPostHog:mainfrom
copperwall:fix-build-issue-with-question-card

Conversation

@copperwall
Copy link
Contributor

This fixes a build failure I'm getting when compiling the project with platfromio. LV_PART_MAIN has the same value (0x000000), but it satisfies the type issue where lv_obj_get_style_pad_top and lv_obj_get_style_pad_bottom expect their second arguments to be an lv_part_t enum. I was able to get a successful build after these changes.

Happy for any feedback!

Before

Building in release mode
Compiling .pio/build/adafruit_feather_esp32s3_reversetft/src/ui/QuestionCard.cpp.o
src/ui/QuestionCard.cpp: In member function 'void QuestionCard::startScrolling()':
src/ui/QuestionCard.cpp:167:64: error: invalid conversion from 'int' to 'lv_part_t' [-fpermissive]
  167 |     lv_coord_t pad_top    = lv_obj_get_style_pad_top   (_cont, 0);
      |                                                                ^
      |                                                                |
      |                                                                int
In file included from .pio/libdeps/adafruit_feather_esp32s3_reversetft/lvgl/src/core/lv_obj_style.h:262,
                 from .pio/libdeps/adafruit_feather_esp32s3_reversetft/lvgl/src/core/lv_obj.h:27,
                 from .pio/libdeps/adafruit_feather_esp32s3_reversetft/lvgl/lvgl.h:44,
                 from src/ui/QuestionCard.h:3,
                 from src/ui/QuestionCard.cpp:1:
.pio/libdeps/adafruit_feather_esp32s3_reversetft/lvgl/src/core/lv_obj_style_gen.h:154:80: note:   initializing argument 2 of 'int32_t lv_obj_get_style_pad_top(const lv_obj_t*, lv_part_t)'
  154 | static inline int32_t lv_obj_get_style_pad_top(const lv_obj_t * obj, lv_part_t part)
      |                                                                      ~~~~~~~~~~^~~~
src/ui/QuestionCard.cpp:168:64: error: invalid conversion from 'int' to 'lv_part_t' [-fpermissive]
  168 |     lv_coord_t pad_bottom = lv_obj_get_style_pad_bottom(_cont, 0);
      |                                                                ^
      |                                                                |
      |                                                                int
.pio/libdeps/adafruit_feather_esp32s3_reversetft/lvgl/src/core/lv_obj_style_gen.h:160:83: note:   initializing argument 2 of 'int32_t lv_obj_get_style_pad_bottom(const lv_obj_t*, lv_part_t)'
  160 | static inline int32_t lv_obj_get_style_pad_bottom(const lv_obj_t * obj, lv_part_t part)

After

Building in release mode
Compiling .pio/build/adafruit_feather_esp32s3_reversetft/src/ui/QuestionCard.cpp.o
Retrieving maximum program size .pio/build/adafruit_feather_esp32s3_reversetft/firmware.elf
Checking size .pio/build/adafruit_feather_esp32s3_reversetft/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [==        ]  24.8% (used 81332 bytes from 327680 bytes)
Flash: [========= ]  88.4% (used 1796194 bytes from 2031616 bytes)
Configuring upload protocol...
AVAILABLE: cmsis-dap, esp-bridge, esp-builtin, esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
Looking for upload port...
Auto-detected: /dev/cu.Bluetooth-Incoming-Port
Forcing reset using 1200bps open/close on port /dev/cu.Bluetooth-Incoming-Port
Waiting for the new upload port...
Uploading .pio/build/adafruit_feather_esp32s3_reversetft/firmware.bin
esptool.py v4.8.9
Serial port /dev/cu.Bluetooth-Incoming-Port

copperwall and others added 2 commits October 30, 2025 22:42
This fixes a build failure when compiling the project with platfromio.
LV_PART_MAIN has the same value, but it satisfies the type issue where
`lv_obj_get_style_pad_top` and `lv_obj_get_style_pad_bottom` expect their
second arguments to be an `lv_part_t` enum.
@daniloc
Copy link
Collaborator

daniloc commented Dec 15, 2025

thank you @copperwall!

@daniloc daniloc merged commit b11361a into PostHog:main Dec 15, 2025
9 checks passed
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.

2 participants