Implement support for ESP32 C6 and P4 SOCs (#421)
- Implement generic ESP32 devices - Updated GitHub Actions to first build the SDKs. These are now based on the generic device implementations and the build act as a filter before compiling the dozens of other devices. It should save on resources when boards fail to compile. - Adapted code to C6 and P4 differences, heavily borrowed from from https://github.com/ByteWelder/Tactility/pull/394 written by @marciogranzotto, with some changes of my own - Updated `device.py` to make the `[display]` section optional
This commit is contained in:
committed by
GitHub
parent
fec8033fd7
commit
b565d56029
@@ -52,6 +52,9 @@ def read_device_properties(device_id):
|
||||
exit_with_error(f"Device file not found: {device_file_path}")
|
||||
return read_properties_file(device_file_path)
|
||||
|
||||
def has_group(properties: ConfigParser, group: str):
|
||||
return group in properties.sections()
|
||||
|
||||
def get_property_or_exit(properties: ConfigParser, group: str, key: str):
|
||||
if group not in properties.sections():
|
||||
exit_with_error(f"Device properties does not contain group: {group}")
|
||||
@@ -171,13 +174,15 @@ def write_performance_improvements(output_file, device_properties: ConfigParser)
|
||||
output_file.write("CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y\n")
|
||||
|
||||
def write_lvgl_variables(output_file, device_properties: ConfigParser):
|
||||
dpi = get_property_or_exit(device_properties, "display", "dpi")
|
||||
output_file.write("# LVGL\n")
|
||||
if has_group(device_properties, "display"):
|
||||
dpi = get_property_or_exit(device_properties, "display", "dpi")
|
||||
output_file.write(f"CONFIG_LV_DPI_DEF={dpi}\n")
|
||||
if has_group(device_properties, "lvgl"):
|
||||
color_depth = get_property_or_exit(device_properties, "lvgl", "colorDepth")
|
||||
output_file.write(f"CONFIG_LV_COLOR_DEPTH={color_depth}\n")
|
||||
output_file.write(f"CONFIG_LV_COLOR_DEPTH_{color_depth}=y\n")
|
||||
output_file.write("CONFIG_LV_DISP_DEF_REFR_PERIOD=10\n")
|
||||
output_file.write(f"CONFIG_LV_DPI_DEF={dpi}\n")
|
||||
color_depth = get_property_or_exit(device_properties, "lvgl", "colorDepth")
|
||||
output_file.write(f"CONFIG_LV_COLOR_DEPTH={color_depth}\n")
|
||||
output_file.write(f"CONFIG_LV_COLOR_DEPTH_{color_depth}=y\n")
|
||||
theme = get_property_or_none(device_properties, "lvgl", "theme")
|
||||
if theme is None or theme == "DefaultDark":
|
||||
output_file.write("CONFIG_LV_THEME_DEFAULT_DARK=y\n")
|
||||
@@ -212,10 +217,10 @@ def write_properties(output_file, device_properties: ConfigParser, device_id: st
|
||||
write_flash_variables(output_file, device_properties)
|
||||
write_partition_table(output_file, device_properties, is_dev)
|
||||
write_spiram_variables(output_file, device_properties)
|
||||
write_lvgl_variables(output_file, device_properties)
|
||||
write_performance_improvements(output_file, device_properties)
|
||||
write_usb_variables(output_file, device_properties)
|
||||
write_custom_sdkconfig(output_file, device_properties)
|
||||
write_lvgl_variables(output_file, device_properties)
|
||||
|
||||
def main(device_id: str, is_dev: bool):
|
||||
device_properties_path = get_properties_file_path(device_id)
|
||||
|
||||
Reference in New Issue
Block a user