Files
STM32F4-Base/test/host/console_log/stub/usart.h
T
wandering1 8a0cb464c0 test(日志): 主机单测桩跟到 UART5
生产源 f5161e15 已把控制台端口收口到 CON_UART(=huart5),桩若还停在
huart1 / MX_USART1_UART_Init,主机单测会因符号缺失编不过;更要紧的是
huart1.Instance = 0 那几组用例会失去"串口未初始化"的原意——改成填一个
生产代码根本不碰的句柄,短路照样命中,但测的已经不是真实那条路径。

- stub/usart.h:暴露 huart5 + MX_UART5_Init,并按真实 Inc/usart.h 校正
  "真实那份还声明哪些"的描述(huart1~4、MX_USART1~3_UART_Init、
  MX_UART4_Init)。
- stub/stm32f4_fake.h:USART1_IRQn -> UART5_IRQn,
  __HAL_RCC_USART1_CLK_DISABLE/ENABLE -> __HAL_RCC_UART5_*;假外设块的
  标题与位注释去掉具体实例号(它本来就是通用模型,不是某个实例)。
- console_log_test.c:huart1 -> huart5(19 处)、
  MX_USART1_UART_Init -> MX_UART5_Init,含一条用例的打印文案。

纯桩与测试改动,不碰生产源;153/153 PASSED。
2026-10-29 18:56:55 +08:00

23 lines
960 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* 模块名称:主机侧单测桩 - usart.h(console_log 模块专用)
* 模块功能:与真实 Inc/usart.h 对本模块可见的部分逐字一致:extern UART_HandleTypeDef
* huart5; + void MX_UART5_Init(void);(真实那份还声明 huart1~4 与
* MX_USART1~3_UART_Init / MX_UART4_Init,本模块只碰 UART5,搬多出来的声明
* 没有意义)。
* 2026-10-29 批 0:控制台从 USART1 迁到 RS232#1/UART5,本桩随之改。
* ⚠ 仅供 test/host/console_log/ 使用,不参与 MCU 构建。
* 真实 Inc/usart.h 的 include 链(main.h -> stm32f4xx_hal.h -> stm32f4xx.h ->
* core_cm4.h)在宿主上编不动,寄存器面由 stm32f4_fake.h 提供(理由见该文件头)。
* 创建日期:2026-10-24
*/
#ifndef USART_H
#define USART_H
#include <stdint.h>
#include "stm32f4_fake.h"
extern UART_HandleTypeDef huart5;
void MX_UART5_Init(void);
#endif /* USART_H */