2024-09-10 00:45:13 +08:00
|
|
|
#ifndef _SYSTEM_RESET_H
|
|
|
|
|
#define _SYSTEM_RESET_H
|
|
|
|
|
|
|
|
|
|
class SystemReset {
|
|
|
|
|
public:
|
2024-10-29 00:22:29 +08:00
|
|
|
static SystemReset& GetInstance() {
|
|
|
|
|
static SystemReset instance;
|
|
|
|
|
return instance;
|
|
|
|
|
}
|
2024-09-10 00:45:13 +08:00
|
|
|
|
|
|
|
|
void CheckButtons();
|
|
|
|
|
|
|
|
|
|
private:
|
2024-10-29 00:22:29 +08:00
|
|
|
SystemReset(); // 构造函数私有化
|
|
|
|
|
SystemReset(const SystemReset&) = delete; // 禁用拷贝构造
|
|
|
|
|
SystemReset& operator=(const SystemReset&) = delete; // 禁用赋值操作
|
|
|
|
|
|
2024-09-10 00:45:13 +08:00
|
|
|
void ResetNvsFlash();
|
|
|
|
|
void ResetToFactory();
|
|
|
|
|
void RestartInSeconds(int seconds);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|