generated from Template/H563ZI-HAL-CMake-Template
新增 DfPlayer 和 CanMv 类,优化 UART 读写方法,更新 CommonCenter 以支持新类实例化
Some checks failed
Build and Upload Artifact / build and upload-artifact (push) Has been cancelled
Some checks failed
Build and Upload Artifact / build and upload-artifact (push) Has been cancelled
This commit is contained in:
19
Core/App/Common/can_mv.hpp
Normal file
19
Core/App/Common/can_mv.hpp
Normal 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;
|
||||
};
|
||||
Reference in New Issue
Block a user