新增 DfPlayer 和 CanMv 类,优化 UART 读写方法,更新 CommonCenter 以支持新类实例化

This commit is contained in:
2025-05-10 19:37:31 +08:00
parent b4ecf03e95
commit 83d9a263a4
7 changed files with 159 additions and 2 deletions

View File

@@ -0,0 +1,19 @@
#pragma once
#include <cstdint>
#include "../Common/serial_port.hpp"
class CanMv {
public:
explicit CanMv(UART_HandleTypeDef* uart) : serialPort(new SerialPort(uart, kLength, kTimeout)) {}
~CanMv() {
delete serialPort;
}
private:
static constexpr uint32_t kLength = 128;
static constexpr uint32_t kTimeout = 10;
SerialPort* serialPort;
};