Skip to content

refactor: 将驱动初始化结构体由 typedef struct 改为具名 struct - #159

Merged
m2rt1n88 merged 1 commit into
mainfrom
Martin/struct_fix
Oct 21, 2026
Merged

m2rt1n88 merged 1 commit into
mainfrom
Martin/struct_fix

Conversation

@m2rt1n88

Copy link
Copy Markdown
Collaborator

将 MPU6500 与 heater 的初始化配置结构体改为 C++ 具名 struct 定义,
不再使用 typedef struct {...} xxx_t 的匿名写法,语义更清晰。
匿名结构体 + 默认成员初始化 + typedef的组合会触发 Clang 的 -Wnon-c-typedef-for-linkage

将 MPU6500 与 heater 的初始化配置结构体改为 C++ 具名 struct 定义,
不再使用 `typedef struct {...} xxx_t` 的匿名写法,语义更清晰。
匿名结构体 + 默认成员初始化 + typedef的组合会触发 Clang 的 -Wnon-c-typedef-for-linkage

@Rinsutoringu Rinsutoringu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@m2rt1n88
m2rt1n88 merged commit 07eb39f into main Oct 21, 2026
1 check passed
@m2rt1n88
m2rt1n88 deleted the Martin/struct_fix branch October 22, 2026 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants