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模式配置位置
This commit is contained in:
@@ -69,7 +69,7 @@ static int sendCanFrameOverSpi(can_channel_t channel, uint32_t ext_id,
|
||||
static int s_last_spi_err = 0;
|
||||
const int err_i = static_cast<int>(ret);
|
||||
if (s_spi_fail_n == 0U || err_i != s_last_spi_err || (s_spi_fail_n % 32U) == 0U) {
|
||||
DEBUG_WARN("CAN", "CAN_SEND SPI失败: ch=%u id=0x%08lX err=%s (x%lu)",
|
||||
DEBUG_WARN("CAN", "SEND SPI fail ch=%u id=%08lX %s x%lu",
|
||||
(unsigned)channel, (unsigned long)ext_id, esp_err_to_name(ret),
|
||||
(unsigned long)(s_spi_fail_n + 1U));
|
||||
}
|
||||
@@ -100,7 +100,7 @@ static int sendCanFrameOverSpi(can_channel_t channel, uint32_t ext_id,
|
||||
static uint32_t s_rej_n = 0U;
|
||||
static uint8_t s_last_rej = 0xFFU;
|
||||
if (s_rej_n == 0U || gd32_err != s_last_rej || (s_rej_n % 32U) == 0U) {
|
||||
DEBUG_WARN("CAN", "CAN_SEND GD32拒绝: ch=%u id=0x%08lX resp=0x%02X err=0x%02X (x%lu)",
|
||||
DEBUG_WARN("CAN", "SEND拒 ch=%u id=%08lX r=%02X e=%02X x%lu",
|
||||
(unsigned)channel, (unsigned long)ext_id, resp_type, gd32_err,
|
||||
(unsigned long)(s_rej_n + 1U));
|
||||
}
|
||||
@@ -280,7 +280,7 @@ int canFdSetRxMode(can_rx_mode_t mode,
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEBUG_WARN("CAN", "SET_MODE 失败: want=%u spi=%s resp=0x%02X len=%u",
|
||||
DEBUG_WARN("CAN", "SET_MODE fail want=%u %s r=0x%02X n=%u",
|
||||
(unsigned)mode,
|
||||
esp_err_to_name(ret),
|
||||
(unsigned)resp_type,
|
||||
|
||||
Reference in New Issue
Block a user