LilyGo T-CameraPlus-S3低版本发布及增加拍照键 (#720)

* set camera HMirror to true

* change key1 to camera button

* change key1 to camera button

* change key1 to camera button
This commit is contained in:
yusuhua
2025-05-30 10:13:18 +08:00
committed by GitHub
parent 47bdfa2c77
commit 6cb025859f
4 changed files with 21 additions and 4 deletions

View File

@@ -74,6 +74,7 @@ private:
Cst816x *cst816d_;
Pmic* pmic_;
LcdDisplay *display_;
Button boot_button_;
Button key1_button_;
PowerSaveTimer* power_save_timer_;
Esp32Camera* camera_;
@@ -220,7 +221,7 @@ private:
}
void InitializeButtons() {
key1_button_.OnClick([this]() {
boot_button_.OnClick([this]() {
auto& app = Application::GetInstance();
if (app.GetDeviceState() == kDeviceStateStarting && !WifiStation::GetInstance().IsConnected()) {
ResetWifiConfiguration();
@@ -228,6 +229,11 @@ private:
power_save_timer_->WakeUp();
app.ToggleChatState();
});
key1_button_.OnClick([this]() {
if (camera_) {
camera_->Capture();
}
});
}
void InitializeCamera() {
@@ -265,7 +271,7 @@ private:
}
public:
LilygoTCameraPlusS3Board() : key1_button_(KEY1_BUTTON_GPIO) {
LilygoTCameraPlusS3Board() : boot_button_(BOOT_BUTTON_GPIO), key1_button_(KEY1_BUTTON_GPIO) {
InitializePowerSaveTimer();
InitI2c();
InitSy6970();