Update to 2.0.1
This commit is contained in:
31
main/boards/esp32s3-smart-speaker/button_manager.h
Normal file
31
main/boards/esp32s3-smart-speaker/button_manager.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef BUTTON_MANAGER_H
|
||||
#define BUTTON_MANAGER_H
|
||||
|
||||
#include "button.h"
|
||||
#include "config.h"
|
||||
|
||||
class ButtonManager {
|
||||
public:
|
||||
static ButtonManager& GetInstance();
|
||||
|
||||
// 初始化按钮系统
|
||||
bool Initialize();
|
||||
|
||||
// 检查是否已初始化
|
||||
bool IsInitialized() const { return initialized_; }
|
||||
|
||||
private:
|
||||
ButtonManager();
|
||||
~ButtonManager() = default;
|
||||
ButtonManager(const ButtonManager&) = delete;
|
||||
ButtonManager& operator=(const ButtonManager&) = delete;
|
||||
|
||||
void SetupButtonCallbacks();
|
||||
|
||||
bool initialized_ = false;
|
||||
Button boot_button_;
|
||||
Button volume_up_button_;
|
||||
Button volume_down_button_;
|
||||
};
|
||||
|
||||
#endif // BUTTON_MANAGER_H
|
||||
Reference in New Issue
Block a user