From 958ea20cc47cd4e2667c6eede90a907bf6838747 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 25 Aug 2026 15:06:29 -0500 Subject: [PATCH] Use the shared pch registration helper --- esphome/components/libretiny/__init__.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/esphome/components/libretiny/__init__.py b/esphome/components/libretiny/__init__.py index 5072b500e7..0d93c7ad4e 100644 --- a/esphome/components/libretiny/__init__.py +++ b/esphome/components/libretiny/__init__.py @@ -2,7 +2,7 @@ import json import logging from pathlib import Path -from esphome.build_helpers.pch import pch_enabled +from esphome.build_helpers.pch import pch_extra_scripts import esphome.codegen as cg import esphome.config_validation as cv from esphome.const import ( @@ -514,11 +514,9 @@ async def component_to_code(config): # it for project source files only. GCC uses the last -O flag. build_src_flags += " -Os" cg.add_platformio_option("build_src_flags", build_src_flags) - extra_scripts = ["pre:ccache.py"] - # Generation-time gate: the script itself has no enable check - if pch_enabled(): - extra_scripts.append("post:pch.py") - cg.add_platformio_option("extra_scripts", extra_scripts) + cg.add_platformio_option( + "extra_scripts", ["pre:ccache.py", *pch_extra_scripts()] + ) # IRAM_ATTR is a no-op on BK72xx (SDK masks FIQ+IRQ around flash ops). # On other families, patch_linker.py routes .sram.text into the right # RAM-executable output section and prints a post-link placement summary.