generated from Template/H563ZI-HAL-CMake-Template
新增 DfPlayer 和 CanMv 类,优化 UART 读写方法,更新 CommonCenter 以支持新类实例化
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "../Common/can_mv.hpp"
|
||||
#include "../Common/df_player.hpp"
|
||||
#include "../Common/ultrasonic.hpp"
|
||||
#include "../config.hpp"
|
||||
|
||||
@@ -13,4 +15,20 @@ public:
|
||||
}
|
||||
return *instance;
|
||||
}
|
||||
|
||||
static DfPlayer& GetDfPlayer() {
|
||||
static DfPlayer* instance = nullptr;
|
||||
if (instance == nullptr) {
|
||||
instance = new DfPlayer(Config::kDfPlayerUart);
|
||||
}
|
||||
return *instance;
|
||||
}
|
||||
|
||||
static CanMv& GetCanMv() {
|
||||
static CanMv* instance = nullptr;
|
||||
if (instance == nullptr) {
|
||||
instance = new CanMv(Config::kCanMvUart);
|
||||
}
|
||||
return *instance;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user