==========================================================================
[A] control.c: ota_close_uart() + uart_stop_for_ota() —— 宿主 gcc 语法检查
==========================================================================
  切出片段行数: ota_close_uart=25, uart_stop_for_ota=43
  gcc exit=0
  => PASS

==========================================================================
[B] 本批改动文件的花括号/圆括号配平
==========================================================================
  control.c          {}=+0  ()=+0  => OK
  control.h          {}=+0  ()=+0  => OK
  hmi.c              {}=+0  ()=+0  => OK
  hmi.h              {}=+0  ()=+0  => OK
  dtu_uart2.c        {}=+0  ()=+0  => OK
  dtu_uart2.h        {}=+0  ()=+0  => OK
  sht30_collect.c    {}=+0  ()=+0  => OK
  => PASS

==========================================================================
[C] 符号一致性: 定义 / 声明 / 引用
==========================================================================
    定义点 1 处: ['applications\\dtu_uart2.c:72']
  serial_485 唯一定义: PASS
  g_hmi_port_closed: 定义=1 extern=1 总引用=7
    => PASS
  sht30_collect.c 已删重复定义并 include dtu_uart2.h: PASS
  uart_stop_for_ota 声明(control.h)+调用(dtu_uart2.c): PASS
  Uart5_Write_Bin 判空 serial_485: PASS
  => PASS

==========================================================================
[D] update 分支调用顺序: 先 thread_stop_all_for_ota() 再 uart_stop_for_ota()
==========================================================================
  匹配到 'thread_stop_all...(); ... uart_stop_for_ota();' 顺序块: 是
  片段:
    | thread_stop_all_for_ota();
    | 
    | /* ---- 再关串口4(HMI屏) 与串口5(485) ----
    | ★ 顺序不能反: 必须先停线程(没人再发数据)再关设备。
    | 反过来的话, 关设备的瞬间还有线程在 HMI_WRITE / Uart5_Write,
    | 会写到正在被拆掉的 tx fifo 上。
    | 关闭后句柄被置 NULL、g_hmi_port_closed 置 1, 所有发送路径
    | 直接 return —— 这段时间对外静默正是升级需要的。 */
    | uart_stop_for_ota();
  uart_stop_for_ota() 之后才是 ymodem_ota(): 是
  => PASS

==========================================================================
总计: 全部通过
==========================================================================