forked from xiaozhi/xiaozhi-esp32
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:
@@ -15,7 +15,7 @@ idf.py menuconfig
|
|||||||
**选择板子:**
|
**选择板子:**
|
||||||
|
|
||||||
```
|
```
|
||||||
Xiaozhi Assistant -> Board Type -> LILYGO T-CameraPlus-S3
|
Xiaozhi Assistant -> Board Type -> LILYGO T-CameraPlus-S3_V1_0_V1_1或LILYGO T-CameraPlus-S3_V1_2
|
||||||
```
|
```
|
||||||
|
|
||||||
**修改 psram 配置:**
|
**修改 psram 配置:**
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#define TOUCH_I2C_SCL_PIN static_cast<gpio_num_t>(TP_SCL)
|
#define TOUCH_I2C_SCL_PIN static_cast<gpio_num_t>(TP_SCL)
|
||||||
|
|
||||||
#define BUILTIN_LED_GPIO GPIO_NUM_NC
|
#define BUILTIN_LED_GPIO GPIO_NUM_NC
|
||||||
|
#define BOOT_BUTTON_GPIO GPIO_NUM_0
|
||||||
#define KEY1_BUTTON_GPIO static_cast<gpio_num_t>(KEY1)
|
#define KEY1_BUTTON_GPIO static_cast<gpio_num_t>(KEY1)
|
||||||
#define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC
|
#define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC
|
||||||
#define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC
|
#define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC
|
||||||
|
|||||||
@@ -3,7 +3,17 @@
|
|||||||
"builds": [
|
"builds": [
|
||||||
{
|
{
|
||||||
"name": "lilygo-t-cameraplus-s3",
|
"name": "lilygo-t-cameraplus-s3",
|
||||||
"sdkconfig_append": ["CONFIG_SPIRAM_MODE_QUAD=y"]
|
"sdkconfig_append": [
|
||||||
|
"CONFIG_SPIRAM_MODE_QUAD=y",
|
||||||
|
"CONFIG_BOARD_TYPE_LILYGO_T_CAMERAPLUS_S3_V1_0_V1_1=y"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "lilygo-t-cameraplus-s3_v1_2",
|
||||||
|
"sdkconfig_append": [
|
||||||
|
"CONFIG_SPIRAM_MODE_QUAD=y",
|
||||||
|
"CONFIG_BOARD_TYPE_LILYGO_T_CAMERAPLUS_S3_V1_2=y"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -74,6 +74,7 @@ private:
|
|||||||
Cst816x *cst816d_;
|
Cst816x *cst816d_;
|
||||||
Pmic* pmic_;
|
Pmic* pmic_;
|
||||||
LcdDisplay *display_;
|
LcdDisplay *display_;
|
||||||
|
Button boot_button_;
|
||||||
Button key1_button_;
|
Button key1_button_;
|
||||||
PowerSaveTimer* power_save_timer_;
|
PowerSaveTimer* power_save_timer_;
|
||||||
Esp32Camera* camera_;
|
Esp32Camera* camera_;
|
||||||
@@ -220,7 +221,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InitializeButtons() {
|
void InitializeButtons() {
|
||||||
key1_button_.OnClick([this]() {
|
boot_button_.OnClick([this]() {
|
||||||
auto& app = Application::GetInstance();
|
auto& app = Application::GetInstance();
|
||||||
if (app.GetDeviceState() == kDeviceStateStarting && !WifiStation::GetInstance().IsConnected()) {
|
if (app.GetDeviceState() == kDeviceStateStarting && !WifiStation::GetInstance().IsConnected()) {
|
||||||
ResetWifiConfiguration();
|
ResetWifiConfiguration();
|
||||||
@@ -228,6 +229,11 @@ private:
|
|||||||
power_save_timer_->WakeUp();
|
power_save_timer_->WakeUp();
|
||||||
app.ToggleChatState();
|
app.ToggleChatState();
|
||||||
});
|
});
|
||||||
|
key1_button_.OnClick([this]() {
|
||||||
|
if (camera_) {
|
||||||
|
camera_->Capture();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitializeCamera() {
|
void InitializeCamera() {
|
||||||
@@ -265,7 +271,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LilygoTCameraPlusS3Board() : key1_button_(KEY1_BUTTON_GPIO) {
|
LilygoTCameraPlusS3Board() : boot_button_(BOOT_BUTTON_GPIO), key1_button_(KEY1_BUTTON_GPIO) {
|
||||||
InitializePowerSaveTimer();
|
InitializePowerSaveTimer();
|
||||||
InitI2c();
|
InitI2c();
|
||||||
InitSy6970();
|
InitSy6970();
|
||||||
|
|||||||
Reference in New Issue
Block a user