删除多个类和结构体的拷贝构造函数和赋值运算符,确保不可复制性
Some checks failed
Build and Upload Artifact / build and upload-artifact (push) Has been cancelled

This commit is contained in:
chauyin
2025-05-21 18:54:12 +08:00
parent 69155f3ce1
commit 75b681e389
10 changed files with 47 additions and 6 deletions

View File

@@ -6,6 +6,12 @@
class GpioHelper {
public:
GpioHelper() = delete;
GpioHelper(const GpioHelper&) = delete;
GpioHelper& operator=(const GpioHelper&) = delete;
GpioHelper(GpioHelper&&) = delete;
GpioHelper& operator=(GpioHelper&&) = delete;
struct Gpio {
GPIO_TypeDef* port;
uint16_t pin;

View File

@@ -4,8 +4,7 @@
#include <cstdint>
#include <stdexcept>
class TaskHelper {
public:
namespace TaskHelper {
template <typename Func>
static void WaitFor(Func func, uint32_t timeoutMilliseconds) {
auto start = HAL_GetTick();
@@ -16,4 +15,4 @@ public:
}
}
}
};
}; // namespace TaskHelper