栈整改不抬栈:删旧档迁移、FIL静态化、日志行缓冲按模块收紧、钩子脱离HAL,defaultTask链5312→2776B

This commit is contained in:
2026-10-10 10:17:00 +08:00
parent 5c978465c9
commit 0779d3a075
54 changed files with 3203 additions and 2770 deletions
+7 -4
View File
@@ -67,7 +67,8 @@ static volatile uint8_t s_mount_fail_reported; /* P2-9:建目录失败日
* 限定条件:仅 defaultTask(唯一写者)调用;卷已挂载
*/
static int s_append(syslog_id_t id, const char *desc) {
FIL f;
static FIL f; /* static:FF_FS_TINY=0 → 局部 FIL 吃 528 B 栈;
* 本函数全程在 vol_lock 区间内,跨任务被卷锁串行化 */
FRESULT fr;
UINT bw = 0u;
uint8_t rec[SYSLOG_REC_SIZE];
@@ -168,7 +169,8 @@ static int s_append(syslog_id_t id, const char *desc) {
* 心跳,绝不能阻塞等锁;busy = 本次读失败(UI 下轮刷新重读,非故障)。
*/
static int s_read_raw(syslog_id_t id, uint32_t idx, uint8_t *p_rec) {
FIL f;
static FIL f; /* static:省 528 B 栈;open~close 全在卷锁区间内
* (uiTask 与写者任务由 vol_lock 串行化,见上方 P2-10 说明) */
FRESULT fr;
UINT br = 0u;
int rc;
@@ -439,11 +441,12 @@ int syslog_last_epoch(syslog_id_t id, uint32_t *p_epoch) {
* 容量护栏:> 8KB 先 unlink 重建,防长跑无界增长(8.3 合法名 wdev.log)。
*/
int sys_log_evidence(const char *p_desc) {
FIL f;
static FIL f; /* static:省 528 B 栈(FF_FS_TINY=0 → FIL=528 B) */
static char line[192]; /* static:省 192 B 栈;本函数只有 poller(defaultTask)
* 一个调用者(task_wd_poll 内),且全程在卷锁区间内 */
FRESULT fr;
UINT bw = 0u;
UINT line_len;
char line[192];
char ts[SYSLOG_TS_LEN + 1u];
int n;
int rc = 0;