# ESP-IDF 侧的 main 组件。 # app_main.c / ulink_esp.c / mlink_esp.c / prov_esp.c / thermal_esp.c / ota_esp.c / warm_esp.c 是 ESP 专用;其余 .c 必须同时在宿主机上编得过 # (新增文件时两处都要加:这里 + host/CMakeLists.txt 的 PHONERAIL_CORE_SRCS)。 idf_component_register( SRCS "app_main.c" "ulink_esp.c" "mlink_esp.c" "version.c" "rail.c" "rail_cfg.c" "i2cbus.c" "slot.c" "sched.c" "tasks.c" "chgmode.c" "hubctl.c" "pdmon.c" "t_safety.c" "t_actuator.c" "t_thermal.c" "evlog.c" "cmd_json.c" "cmd.c" "cmd_exec.c" "cmd_report.c" "ulink.c" "cmd_net.c" "netcfg.c" "mlink.c" "prov.c" "prov_esp.c" "bringup.c" "ntc.c" "thermal_esp.c" "ota.c" "ota_esp.c" "warm_esp.c" INCLUDE_DIRS "." EMBED_TXTFILES "certs/evse_ca.pem" "prov.html" REQUIRES phonerail_hal drv esp_driver_usb_serial_jtag esp_wifi esp_netif esp_event esp_timer nvs_flash mqtt esp_adc esp_driver_pcnt app_update esp_http_client mbedtls esp_http_server lwip) # warm_esp.c 的能力标记(.rodata_custom_desc,镜像第 288 字节)没有代码引用它, # 不加 -u 会被 --gc-sections 丢掉 —— 那样每个新固件都会被当成「不认接管」,EN 永远不锁(安全,但功能白做)。 target_link_libraries(${COMPONENT_LIB} INTERFACE "-u g_phonerail_caps")