栈整改不抬栈:删旧档迁移、FIL静态化、日志行缓冲按模块收紧、钩子脱离HAL,defaultTask链5312→2776B
This commit is contained in:
+13
-2
@@ -33,6 +33,10 @@
|
||||
#include "cfg_file.h"
|
||||
#include "sys_log.h"
|
||||
#include "sys_events.h"
|
||||
/* 深调用链模块(本任务 = 存储 bring-up + 配置引擎属主 + syslog 唯一写者,
|
||||
* 全项目最深链在此):日志行缓冲收到 128 B(默认 192),本模块最长行渲染后
|
||||
* < 128 → 不截断 */
|
||||
#define DBG_LINE_BUF_MAX 128U
|
||||
#include "dbg_log.h"
|
||||
#include "task_watchdog.h"
|
||||
#include "vol_lock.h"
|
||||
@@ -191,6 +195,12 @@ void default_task_func(void *argument) {
|
||||
/* 控制台唯一发送点:把环形缓冲中的日志按块发出(无待发时立即返回) */
|
||||
task_wd_seg(TASK_WD_SEG_DRAIN);
|
||||
dbg_console_drain();
|
||||
/* 控制台 TX 故障留痕:由本任务(syslog 唯一写者)在 drain **之外**补记 run.log。
|
||||
* console_log 内部刻意不调 syslog_post —— 那会构成日志调用图成环,
|
||||
* 让 armlink 静态栈深在每个任务上都多叠一条日志尾巴(见 console_log.c) */
|
||||
if (dbg_console_tx_fault_log_take() != 0U) {
|
||||
syslog_post(SYSLOG_RUN, "console tx fault, uart reinit");
|
||||
}
|
||||
/* 执行待处理保存(配置引擎属主:写盘 + 成功后立即应用);无请求 = 空操作 */
|
||||
#if !defined(TEST_SUITE_STORAGE)
|
||||
task_wd_seg(TASK_WD_SEG_CFGSAVE);
|
||||
@@ -405,7 +415,8 @@ static FRESULT storage_bring_up(FATFS *fs) {
|
||||
* 判定、不碰盘)→ 曾误入下方结构性错误集合 → 每 boot 假失败 →
|
||||
* 无限重格式化。探针名必须严格 8.3:名≤8、扩展≤3、不以点开头。 */
|
||||
#define FS_VOL_PROBE(h) do { \
|
||||
FIL __chk; \
|
||||
static FIL __chk; /* static:FF_FS_TINY=0 → 局部 FIL 吃 528 B 栈;探针只在 \
|
||||
* defaultTask 启动/自愈路径跑,无并发 */ \
|
||||
static const uint8_t __chkbuf[8] = { 0 }; \
|
||||
UINT __bw = 0u; \
|
||||
FRESULT __wr; \
|
||||
@@ -465,7 +476,7 @@ static FRESULT storage_bring_up(FATFS *fs) {
|
||||
DBG_INFO("[FS] FATFS mounted");
|
||||
/* 日志引擎挂载后处理:建 /log 目录 + 写"上电/重启"分类记录(唯一写者) */
|
||||
syslog_mcu_mounted();
|
||||
/* 加载网络配置进 RAM 副本(配置引擎属主 = 本任务;首启含旧档迁移;
|
||||
/* 加载网络配置进 RAM 副本(配置引擎属主 = 本任务;只读 INI,
|
||||
* 文件缺失/损坏 = 工厂默认,不阻塞组网)。须在置位 STORAGE_READY 前,
|
||||
* 使"存储就绪"屏障蕴含"配置已就绪",netTask 组网时配置恒有效 */
|
||||
(void)net_cfg_load();
|
||||
|
||||
Reference in New Issue
Block a user