fix(CAN): 使用DMA优化CAN通信数据收发

重新配置CAN引脚映射并实现基于DMA的数据收发机制,提升通信效率。增加了DMA通道4和5的中断处理函数,用于接收和发送CAN消息。修改了CAN发送函数以支持DMA传输,并去除了原有的轮询等待机制。

feat(ADC): 重新实现ADC与DMA初始化配置
将ADC和DMA的配置迁移至ADC.cpp文件中,完善了DMA循环采样模式配置及ADC多通道扫描功能。删除了initial.cpp中重复的初始化代码,并修正了相关头文件包含。

chore(headers): 清理冗余头文件引用
多个源文件中删除了不必要的标准库和硬件无关头文件引用,减少编译依赖,提高代码清晰度。
This commit is contained in:
cbb
2025-11-01 20:29:11 +08:00
parent 867a37ff79
commit 71a92fa68e
12 changed files with 258 additions and 171 deletions
+1 -10
View File
@@ -1,13 +1,4 @@
#include "Can.h"
#include "Filter.h"
#include "Timer.h"
#include "adc.h"
#include "core_cm4.h"
#include "initial.h"
#include "main.h"
#include "sys/initial.h"
#include "systick.h"
#include <cinttypes>
#include <cstdio>
constexpr int status_print = 0;
@@ -19,7 +10,7 @@ void test_1111() {
if (status_print) {
/* value print */
printf(" the temperature data is %2.2f degrees Celsius\r\n",
sampler.get_mcu_temp());
sampler.get_mcu_temp());
printf(" the drv_temperature data is %2.2f degrees Celsius\r\n",
sampler.get_drv_temp());
printf(" the U current data is %2.2f mA\r\n", sampler.get_current('U'));