修复规范矛盾并定案5项规则,保护宏统一XXX_H

规则定案:常量在右(a>5)、保护宏XXX_H(禁双下划线)、
头文件常量用#define、存储类前缀(g_/s_)优先、允许void返回值
全库32个.h头文件保护宏 __XXX_H → XXX_H 改名(字节级替换)
S1检查规则同步更新(拒绝双下划线),Inc/gpio.h 反向验证被正确拦截
规范示例矛盾修复:K&R括号、标准类型、变量初始化、命名常量、注释字段补全
This commit is contained in:
2026-09-01 16:07:00 +08:00
parent 2b66f96d01
commit bb76cfd779
35 changed files with 158 additions and 138 deletions
+3 -3
View File
@@ -8,8 +8,8 @@
* v1.0 2026-07-19 王建锋 创建初始版本
*/
#ifndef __APP_CFG_H
#define __APP_CFG_H
#ifndef APP_CFG_H
#define APP_CFG_H
#ifdef __cplusplus
extern "C" {
@@ -33,4 +33,4 @@ extern "C" {
}
#endif
#endif /* __APP_CFG_H */
#endif /* APP_CFG_H */
+3 -3
View File
@@ -8,8 +8,8 @@
* v1.0 2026-07-19 王建锋 创建初始版本
*/
#ifndef __APP_MAIN_H
#define __APP_MAIN_H
#ifndef APP_MAIN_H
#define APP_MAIN_H
#ifdef __cplusplus
extern "C" {
@@ -24,4 +24,4 @@ void app_main_run(void);
}
#endif
#endif /* __APP_MAIN_H */
#endif /* APP_MAIN_H */
+3 -3
View File
@@ -9,8 +9,8 @@
* v1.0 2026-07-19 王建锋 创建初始版本
*/
#ifndef __SYS_CLOCK_H
#define __SYS_CLOCK_H
#ifndef SYS_CLOCK_H
#define SYS_CLOCK_H
#ifdef __cplusplus
extern "C" {
@@ -72,4 +72,4 @@ int sys_clock_set_unix(uint32_t unix_secs);
}
#endif
#endif /* __SYS_CLOCK_H */
#endif /* SYS_CLOCK_H */
+3 -3
View File
@@ -9,8 +9,8 @@
* 创建日期:2026-08-29
*/
#ifndef __SYS_EVENTS_H
#define __SYS_EVENTS_H
#ifndef SYS_EVENTS_H
#define SYS_EVENTS_H
#include "cmsis_os2.h"
@@ -32,4 +32,4 @@ extern osEventFlagsId_t sys_evtHandle;
}
#endif
#endif /* __SYS_EVENTS_H */
#endif /* SYS_EVENTS_H */
+3 -3
View File
@@ -8,8 +8,8 @@
* v1.0 2026-07-19 王建锋 创建初始版本
*/
#ifndef __ADC_TASK_H
#define __ADC_TASK_H
#ifndef ADC_TASK_H
#define ADC_TASK_H
#ifdef __cplusplus
extern "C" {
@@ -22,4 +22,4 @@ void adc_task_func(void const *arg);
}
#endif
#endif /* __ADC_TASK_H */
#endif /* ADC_TASK_H */
+3 -3
View File
@@ -9,8 +9,8 @@
* v1.1 2026-08-24 王建锋 提取 net_stack_bring_up() 供硬件层/NET 层两种测试模式共用
*/
#ifndef __NET_TASK_H
#define __NET_TASK_H
#ifndef NET_TASK_H
#define NET_TASK_H
#ifdef __cplusplus
extern "C" {
@@ -28,4 +28,4 @@ void net_task_func(void const *arg);
}
#endif
#endif /* __NET_TASK_H */
#endif /* NET_TASK_H */
+3 -3
View File
@@ -8,8 +8,8 @@
* v1.0 2026-07-19 王建锋 创建初始版本
*/
#ifndef __RS485_TASK_H
#define __RS485_TASK_H
#ifndef RS485_TASK_H
#define RS485_TASK_H
#ifdef __cplusplus
extern "C" {
@@ -22,4 +22,4 @@ void rs485_task_func(void const *arg);
}
#endif
#endif /* __RS485_TASK_H */
#endif /* RS485_TASK_H */
+3 -3
View File
@@ -7,8 +7,8 @@
* 修改记录:
* 2026-08-29 王建锋 创建初始版本
*/
#ifndef __UI_TASK_H
#define __UI_TASK_H
#ifndef UI_TASK_H
#define UI_TASK_H
#ifdef __cplusplus
extern "C" {
@@ -29,4 +29,4 @@ void ui_task_func(void *argument);
}
#endif
#endif /* __UI_TASK_H */
#endif /* UI_TASK_H */
+3 -3
View File
@@ -10,8 +10,8 @@
* v1.1 2026-08-28 王建锋 改为 TCP Server,迁入独立任务 timeSyncTask
*/
#ifndef __TIME_SYNC_H
#define __TIME_SYNC_H
#ifndef TIME_SYNC_H
#define TIME_SYNC_H
#include <stdint.h>
@@ -37,4 +37,4 @@ void timeSyncTask(void *argument);
}
#endif
#endif /* __TIME_SYNC_H */
#endif /* TIME_SYNC_H */
+3 -3
View File
@@ -8,8 +8,8 @@
* v1.0 2026-07-19 王建锋 创建初始版本
*/
#ifndef __CRC_H
#define __CRC_H
#ifndef CRC_H
#define CRC_H
#ifdef __cplusplus
extern "C" {
@@ -25,4 +25,4 @@ uint8_t crc8(const uint8_t *data, size_t len);
}
#endif
#endif /* __CRC_H */
#endif /* CRC_H */
+3 -3
View File
@@ -8,8 +8,8 @@
* v1.0 2026-07-19 王建锋 创建初始版本
*/
#ifndef __RINGBUF_H
#define __RINGBUF_H
#ifndef RINGBUF_H
#define RINGBUF_H
#ifdef __cplusplus
extern "C" {
@@ -39,4 +39,4 @@ void ringbuf_reset(ringbuf_t *rb);
}
#endif
#endif /* __RINGBUF_H */
#endif /* RINGBUF_H */