新增代码规范检查钩子(规范V1.0 可机械校验项)并修复存量违规

新增 scripts/check_coding_standard.py + coding-standard 钩子(S1~S9:
头文件保护宏、文件头注释、宏大写、_t 后缀、switch default、
禁 strcpy/sprintf/goto/Tab、函数注释)
修复存量违规:NET_* 字节序宏大写化、net_fd_set 等类型加 _t 后缀、
net_inet_ntoa 的 sprintf 改 snprintf、补 4 处函数注释与 ui_task.c 文件头
docs/代码规范/pre-commit使用说明.md:新增 2.8 节,修正失效文档路径
This commit is contained in:
2026-09-01 15:41:25 +08:00
parent 07afb7b468
commit 2b66f96d01
12 changed files with 278 additions and 72 deletions
+8
View File
@@ -358,6 +358,14 @@ int sys_clock_set(uint32_t unix_secs, const sd2506_time_t *sd_time)
return 0;
}
/*
* 函数功能:设置系统时间为指定 Unix 秒数并写回 RTC
* 入口参数:unix_secs - Unix 时间戳(秒) uint32_t
* 返回值:0 - 成功 int
* 限定条件:无
* 函数说明:将 Unix 秒数转换为 SD2506 时间结构,再调用 sys_clock_set()
* 更新运行期基准并写回 RTC,实现掉电保持
*/
int sys_clock_set_unix(uint32_t unix_secs)
{
sd2506_time_t sd;