mirror of
https://github.com/78/xiaozhi-esp32.git
synced 2026-02-11 06:33:48 +00:00
Fix abnormal screen and camera display on DF K10 when running on Box (#1648)
* 解决屏幕和摄像头无法初始化问题 * 修改摄像头时钟 * change readme * chang config
This commit is contained in:
@@ -30,8 +30,24 @@ Xiaozhi Assistant -> Board Type -> DFRobot 行空板 K10
|
||||
Component config -> ESP PSRAM -> SPI RAM config -> Mode (QUAD/OCT) -> Octal Mode PSRAM
|
||||
```
|
||||
|
||||
**使能摄像头缓冲区大小端交换:**
|
||||
|
||||
```
|
||||
Xiaozhi Assistant -> Camera Configuration -> Enable software camera buffer endianness swapping
|
||||
```
|
||||
|
||||
**配置摄像头:**
|
||||
|
||||
```
|
||||
Component config -> Espressif Camera Sensors Configurations -> Camera Sensor Configuration -> Select and Set Camera Sensor -> GC2145 -> Select default output format for DVP interface (RGB565 800x600 20fps, DVP 8-bit, 20M input) -> RGB565 800x600 20fps, DVP 8-bit, 20M input
|
||||
|
||||
```
|
||||
|
||||
**编译:**
|
||||
|
||||
```bash
|
||||
idf.py build
|
||||
```
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -71,6 +71,6 @@
|
||||
#define CAMERA_PIN_HREF HREF_GPIO_NUM
|
||||
#define CAMERA_PIN_PCLK PCLK_GPIO_NUM
|
||||
|
||||
#define XCLK_FREQ_HZ 20000000
|
||||
#define XCLK_FREQ_HZ 6000000
|
||||
|
||||
#endif // _BOARD_CONFIG_H_
|
||||
|
||||
@@ -4,7 +4,11 @@
|
||||
{
|
||||
"name": "df-k10",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_SPIRAM_MODE_OCT=y"
|
||||
"CONFIG_SPIRAM_MODE_OCT=y",
|
||||
"CONFIG_CAMERA_GC2145=y",
|
||||
"CONFIG_CAMERA_GC2145_AUTO_DETECT_DVP_INTERFACE_SENSOR=y",
|
||||
"CONFIG_CAMERA_GC2145_DVP_RGB565_800X600_20FPS=y",
|
||||
"CONFIG_XIAOZHI_ENABLE_CAMERA_ENDIANNESS_SWAP=y"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -84,12 +84,17 @@ private:
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGE(TAG, "Print state failed: %s", esp_err_to_name(ret));
|
||||
}
|
||||
ret = esp_io_expander_set_dir(io_expander, IO_EXPANDER_PIN_NUM_0,
|
||||
IO_EXPANDER_OUTPUT);
|
||||
|
||||
ret = esp_io_expander_set_dir(io_expander, IO_EXPANDER_PIN_NUM_0 | IO_EXPANDER_PIN_NUM_1, IO_EXPANDER_OUTPUT);
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGE(TAG, "Set direction failed: %s", esp_err_to_name(ret));
|
||||
}
|
||||
ret = esp_io_expander_set_level(io_expander, 0, 1);
|
||||
ret = esp_io_expander_set_level(io_expander, IO_EXPANDER_PIN_NUM_0 | IO_EXPANDER_PIN_NUM_1, 0);
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGE(TAG, "Set level failed: %s", esp_err_to_name(ret));
|
||||
}
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
ret = esp_io_expander_set_level(io_expander, IO_EXPANDER_PIN_NUM_0 | IO_EXPANDER_PIN_NUM_1, 1);
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGE(TAG, "Set level failed: %s", esp_err_to_name(ret));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user