Files
ESP32_COMM/main/monitor/task_stack.h
T
小龙虾 00b716c8db refactor(debug): 重构调试日志环形缓冲区管理
- 将日志环形缓冲区从静态数组改为动态堆分配
- 实现启动时大容量缓冲区和运行时小容量缓冲区的切换机制
- 添加日志环满时优先保留错误和警告信息的清理策略
- 优化内存使用,在日志为空时避免不必要的内存分配
- 移除调试日志中的冗余字段显示

feat(api): 更新CAN接口为批量发送模式

- 将 `/can/send` 接口替换为 `/can/send_batch`,支持1到N帧的批量发送
- 更新API文档中的接口描述和使用示例
- 修改请求参数格式为 `{"ch":0,"frames":[{...}]}` 返回格式为 `{"status":"ok","results":[...]}`
- 单帧发送也需要通过send_batch接口实现

feat(monitor): 新增GD32 ADC调试反馈处理功能

- 添加gd32_adc_feedback组件用于解析0xC4类型的SPI反馈
- 实现ADC数据解析包括温度、电压等参数的计算和转换
- 在can_feedback_task中集成ADC反馈分发逻辑
- 添加线程安全的数据获取和年龄检查接口

refactor(config): 优化任务栈大小配置并调整OTA块大小

- 重新评估各任务栈使用情况,优化HTTP、WiFi、SPI等工作任务的栈大小
- 将HTTP服务器栈从8KB调整至7KB,WiFi OTA任务栈从4KB调整至3KB
- OTA块大小从2KB调整回4KB以提升传输吞吐性能
- 重新整理配置文件结构,移动WiFi模式配置位置
2026-07-20 03:10:42 +08:00

41 lines
1.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* task_stack.h - 任务栈:水位收集 + 溢出钩子
*
* 1) collectTaskStackMetrics:供 health_mon 巡检与 /system/status 共用任务表
* 2) vApplicationStackOverflowHook / g_stackOverflowDetected:canary 溢出
*/
#pragma once
#include <stddef.h>
#include <stdbool.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#ifdef __cplusplus
extern "C" {
#endif
/** canary 触发时由 vApplicationStackOverflowHook 置位(随后 abort)。 */
extern volatile bool g_stackOverflowDetected;
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
/** @brief 单个任务的栈指标描述。 */
struct TaskStackMetric {
const char* name; ///< 任务名(展示用)
TaskHandle_t handle; ///< 句柄(可能为 NULL:任务尚未创建)
size_t stack_size_bytes; ///< 创建时分配的栈大小(字节)
};
/**
* @brief 收集受监控任务的栈指标。
* @return 实际写入条数(<= max)。handle==NULL 的条目由调用方跳过。
*/
size_t collectTaskStackMetrics(TaskStackMetric* out, size_t max);
#endif /* __cplusplus */