generated from Template/H563ZI-HAL-CMake-Template
Some checks failed
Build and Upload Artifact / build and upload-artifact (push) Has been cancelled
35 lines
915 B
C++
35 lines
915 B
C++
#pragma once
|
|
|
|
#include "../Common/can_mv.hpp"
|
|
#include "../Common/df_player.hpp"
|
|
#include "../Common/ultrasonic.hpp"
|
|
#include "../config.hpp"
|
|
|
|
class CommonCenter {
|
|
public:
|
|
static Ultrasonic& GetUltrasonic() {
|
|
static Ultrasonic* instance = nullptr;
|
|
if (instance == nullptr) {
|
|
instance = new Ultrasonic(
|
|
Config::kCaptureConfig.trigger, Config::kCaptureConfig.timer, Config::kCaptureConfig.channel);
|
|
}
|
|
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;
|
|
}
|
|
};
|