Tab5 audio, I2C improvements, UiDensity moved to lvgl-module and cleanup#506
Tab5 audio, I2C improvements, UiDensity moved to lvgl-module and cleanup#506KenVanHoeylandt merged 8 commits intomainfrom
Conversation
📝 WalkthroughWalkthroughAdds CMake property-parsing helpers and reads uiDensity from device.properties for multiple devices. Removes UiDensity from the HAL Configuration and deletes related C ABI wrappers. Introduces LVGL-facing compile definitions and a new function 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (3)
Devices/m5stack-tab5/Source/Configuration.cpp (1)
145-145: Nit: trailing whitespace before the comma.- error = i2c_controller_register8_set_bits(i2c_controller, IO_EXPANDER1_ADDRESS, AMP_REGISTER, 0b00000010 , pdMS_TO_TICKS(100)); + error = i2c_controller_register8_set_bits(i2c_controller, IO_EXPANDER1_ADDRESS, AMP_REGISTER, 0b00000010, pdMS_TO_TICKS(100));Buildscripts/properties.cmake (2)
52-52: Flat-list map: value-as-key collision risk withlist(FIND ...).The map is stored as a flat alternating list
[key0, val0, key1, val1, ...].list(FIND ...)returns the index of the first occurrence of the string in the entire list — it doesn't distinguish keys from values. If a value string happens to equal a subsequent key string,GET_VALUE_FROM_MAPwill return incorrect results.For the current use case (device.properties with simple values like
"compact"and section-prefixed keys like[lvgl]uiDensity), collisions are extremely unlikely. Just calling it out as a latent limitation.A safer alternative would be to use CMake's
CACHEvariables or a naming-convention approach (e.g.,set(MAP_${KEY} "${VALUE}")) for true O(1) lookups without collision risk.Also applies to: 59-69
40-41: Section brackets are included in the stored key prefix.The section line (e.g.,
[lvgl]) is stored verbatim as the prefix, so callers must look up keys as[lvgl]uiDensityrather thanlvgl.uiDensityor similar. This is fine as long as it's a deliberate convention — just noting it for documentation clarity.
Summary by CodeRabbit
New Features
Improvements