Skip to content

Commit d42e012

Browse files
committed
Merge branch 'feature/add_idf_ext_py_for_board_manager' into 'main'
feat(esp_board_manager): Integrate board manager as IDF action with auto-discovery See merge request adf/multimedia/esp-gmf!182
2 parents ca96e19 + 60986f5 commit d42e012

File tree

29 files changed

+743
-342
lines changed

29 files changed

+743
-342
lines changed

packages/esp_board_manager/CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
# Changelog
22

3-
## Unreleased
3+
## v0.4.1
4+
5+
### Features
6+
- Renamed esp_board_manager_ext.py to idf_ext.py for compatibility with ESP-IDF v6.0 auto-discovery
7+
- Update `Kconfig.in` with new configuration options to hide the board selection menu
8+
- Update the README to include information about how to add new boards and the development roadmap
9+
- Added the esp_board_periph_ref_handle and esp_board_periph_unref_handle APIs to obtain and release a handle
10+
- Added esp_board_find_utils.h and esp_board_manager_includes.h
411

512
### Bug Fixes
13+
- Delete only `build/CMakeCache.txt` to avoid a full clean when switching boards
614
- Fixed the configuration of the sdmmc sdcard host slot, ensuring the configuration for the host slot in the yml file takes effect correctly
715
- Using slot 0 to drive the sdcard for p4_function board, avoiding conflict with wifi hosted
16+
- Correct the error codes
817

918
## v0.4.0
1019

packages/esp_board_manager/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ idf_component_register(
2323
INCLUDE_DIRS
2424
"."
2525
"include"
26+
"private_inc"
2627
${PERIPH_INCLUDES} # Add peripheral includes
2728
${DEVICE_INCLUDES} # Add device includes
2829
REQUIRES

packages/esp_board_manager/README.md

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ esp_board_manager/
5353
│ ├── CMakeLists.txt
5454
│ └── idf_component.yml
5555
├── gen_bmgr_config_codes.py # Main code generation script (unified)
56-
├── esp_board_manager_ext.py # IDF action extension
56+
├── idf_ext.py # IDF action extension (Auto-discovery in v6.0+)
5757
├── README.md # This file
5858
└── README_CN.md # Chinese version Readme
5959
```
@@ -62,7 +62,9 @@ esp_board_manager/
6262

6363
### 1. Setup IDF Action Extension
6464

65-
The ESP Board Manager now supports IDF action extension, providing seamless integration with the ESP-IDF build system. Set the `IDF_EXTRA_ACTIONS_PATH` environment variable to include the ESP Board Manager directory:
65+
The ESP Board Manager now supports IDF action extension, providing seamless integration with the ESP-IDF build system. This feature allows you to use `idf.py gen-bmgr-config` command directly instead of running the Python script manually.
66+
67+
Set the `IDF_EXTRA_ACTIONS_PATH` environment variable to include the ESP Board Manager directory:
6668

6769
**Ubuntu and Mac:**
6870

@@ -91,7 +93,9 @@ export IDF_EXTRA_ACTIONS_PATH=YOUR_PROJECT_ROOT_PATH/managed_components/XXXX__es
9193
Note:
9294
> **Note:** If you use `idf.py add-dependency xxx` to add **esp_board_manager** as a dependency, the directory `YOUR_PROJECT_ROOT_PATH/managed_components/XXXX__esp_board_manager` will not be available on the first build or after cleaning the `managed_components` folder. We recommend running `idf.py set-target`, `idf.py menuconfig`, or `idf.py build` to automatically download the **esp_board_manager** component into `YOUR_PROJECT_ROOT_PATH/managed_components/XXXX__esp_board_manager`.
9395
94-
> **Version Requirement:** Supports ESP-IDF v5.4 and later versions
96+
> **Version Requirement:** Compatible with ESP-IDF v5.4 and v5.5 branches. **Note:** Versions prior to v5.4.2 or v5.5.1 may encounter Kconfig dependency issues.
97+
98+
> **Note:** IDF action extension auto-discovery is available starting from ESP-IDF v6.0. No need to set `IDF_EXTRA_ACTIONS_PATH` beginning with IDF v6.0, as it automatically discovers the IDF action extension.
9599
96100
If you encounter any issues, please refer to the [## Troubleshooting](#troubleshooting) section.
97101

@@ -247,6 +251,9 @@ For detailed YAML configuration rules and format specifications, please refer to
247251
```
248252
249253
5. **Define Peripherals**
254+
- Find similar peripheral configuration YML files in `boards` for reference
255+
- Configure based on supported peripheral YML files under `peripherals`
256+
The basic structure for each peripheral is as follows:
250257
```yaml
251258
# board_peripherals.yaml
252259
board: <board_name>
@@ -262,6 +269,9 @@ For detailed YAML configuration rules and format specifications, please refer to
262269
```
263270

264271
6. **Define Devices**
272+
- Find similar device configuration YML files in `boards` for reference
273+
- Configure based on supported device YML files under `devices`
274+
The basic structure for each device is as follows:
265275
```yaml
266276
# board_devices.yaml
267277
board: <board_name>
@@ -288,6 +298,15 @@ For detailed YAML configuration rules and format specifications, please refer to
288298
- name: <peripheral_name>
289299
```
290300

301+
7. **Custom Code in Board Directory**
302+
- When using certain devices, additional custom code may be required, such as for `display_lcd`, `lcd_touch`, and `custom` devices.
303+
- This is to improve board adaptation, allowing users to select the actual device initialization function based on their board's specific requirements. For `display_lcd` and `lcd_touch`, refer to `esp_board_manager/boards/echoear_core_board_v1_2/setup_device.c`.
304+
305+
8. **Custom Device Description**
306+
- For devices and peripherals not yet included in esp_board_manager, it is recommended to add them through `custom` type devices.
307+
- Implementation code should be placed in the `board` directory. Refer to `esp_board_manager/boards/esp32_s3_korvo2l/custom_device.c`.
308+
- When the board is selected, a `gen_board_device_custom.h` header file will be generated in the `gen_bmgr_codes` directory for application use.
309+
291310
> **⚙️ About `dependencies` Usage**
292311
>
293312
> - * The `dependencies` field in `board_devices.yaml` allows you to specify component dependencies for each device. This is especially useful for boards that require custom or local versions of components.
@@ -376,7 +395,7 @@ When multiple boards with the same name exist across different paths, the ESP Bo
376395

377396
| Device | Type | Chip | Peripheral | Status | Description | Reference YAML |
378397
|--------|------|------|------------|--------|-------------|----------------|
379-
| Audio Codec | audio_codec | ES8311/ES7210 | i2s/i2c | ✅ Supported | Audio codec with DAC/ADC | [`dev_audio_codec.yaml`](devices/dev_audio_codec/dev_audio_codec.yaml) |
398+
| Audio Codec | audio_codec | ES8311/ES7210/ES8388 | i2s/i2c | ✅ Supported | Audio codec with DAC/ADC | [`dev_audio_codec.yaml`](devices/dev_audio_codec/dev_audio_codec.yaml) |
380399
| LCD Display | display_lcd_spi | ST77916/GC9A01 | spi | ✅ Supported | SPI LCD display | [`dev_display_lcd_spi.yaml`](devices/dev_display_lcd_spi/dev_display_lcd_spi.yaml) |
381400
| Touch Screen | lcd_touch_i2c | FT5x06 | i2c | ✅ Supported | I2C touch screen | [`dev_lcd_touch_i2c.yaml`](devices/dev_lcd_touch_i2c/dev_lcd_touch_i2c.yaml) |
382401
| SD Card | fatfs_sdcard | - | sdmmc | ✅ Supported | SD card storage | [`dev_fatfs_sdcard.yaml`](devices/dev_fatfs_sdcard/dev_fatfs_sdcard.yaml) |
@@ -564,14 +583,14 @@ python gen_bmgr_config_codes.py --sdkconfig-only
564583

565584
## Roadmap
566585

567-
Future development plans for the ESP Board Manager:
568-
- **Build Workflow**: Improve the efficiency and streamline the build workflow
586+
Future development plans for the ESP Board Manager (prioritized from high to low):
587+
- **Support More Peripherals and Devices**: Add more peripherals, devices, and boards
588+
- **Web Visual Configuration**: Combine with large models to achieve visual and intelligent board configuration through web interface
589+
- **Documentation Enhancement**: Add more documentation, such as establishing clear rules to facilitate customer addition of peripherals and devices
590+
- **Enhanced Validation**: Comprehensive YAML format checking, schema validation, input validation, and enhanced rule validation
591+
- **Enhanced data structure**: Enhance the data or YAML structure to improve performance
569592
- **Version Management**: Support different version codes and parsers for devices and peripherals
570593
- **Plugin Architecture**: Extensible plugin system for custom device and peripheral support
571-
- **Enhanced Validation**: Comprehensive YAML format checking, schema validation, input validation, and enhanced rule validation with improved error reporting
572-
- **Enhanced Initialization Flow**: Support for skipping specific components or calling initialization on different cores
573-
- **Clear Definition Rules**: Establish clear rules to facilitate customer addition of peripherals and devices
574-
- **Extended Component Support**: Add more peripherals, devices, and boards
575594

576595
## Troubleshooting
577596

packages/esp_board_manager/README_CN.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ esp_board_manager/
5353
│ ├── CMakeLists.txt
5454
│ └── idf_component.yml
5555
├── gen_bmgr_config_codes.py # 主代码生成脚本(统一)
56-
├── esp_board_manager_ext.py # IDF action 扩展
56+
├── idf_ext.py # IDF action 扩展(v6.0+ 自动发现)
5757
├── README.md # 此文件
5858
└── README_CN.md # 中文版本说明
5959
```
@@ -62,7 +62,9 @@ esp_board_manager/
6262

6363
### 1. 设置 IDF Action 扩展
6464

65-
ESP Board Manager 现在支持 IDF action 扩展,提供与 ESP-IDF 构建系统的无缝集成。设置 `IDF_EXTRA_ACTIONS_PATH` 环境变量以包含 ESP Board Manager 目录:
65+
ESP Board Manager 现在支持 IDF action 扩展,提供与 ESP-IDF 构建系统的无缝集成。此功能允许您直接使用 `idf.py gen-bmgr-config` 命令,而无需手动运行 Python 脚本。
66+
67+
设置 `IDF_EXTRA_ACTIONS_PATH` 环境变量以包含 ESP Board Manager 目录:
6668

6769
**Ubuntu and Mac:**
6870

@@ -90,7 +92,9 @@ export IDF_EXTRA_ACTIONS_PATH=YOUR_PROJECT_ROOT_PATH/managed_components/XXXX__es
9092

9193
> **注意:** 如果您使用 `idf.py add-dependency xxx`**esp_board_manager** 添加为依赖组件,在首次构建或清理 `managed_components` 文件夹后,目录 `YOUR_PROJECT_ROOT_PATH/managed_components/XXXX__esp_board_manager` 将不可见。我们建议运行 `idf.py set-target``idf.py menuconfig``idf.py build` 来自动将 **esp_board_manager** 组件下载到 `YOUR_PROJECT_ROOT_PATH/managed_components/XXXX__esp_board_manager`
9294
93-
> **版本要求:** 支持 ESP-IDF v5.4 及以后的版本
95+
> **版本要求:** 兼容 ESP-IDF v5.4 和 v5.5 分支。**注意:** v5.4.2 或 v5.5.1 之前的版本可能会遇到 Kconfig 依赖问题。
96+
97+
> **注意:** IDF action 扩展自动发现功能从 ESP-IDF v6.0 开始可用。从 IDF v6.0 开始无需设置 `IDF_EXTRA_ACTIONS_PATH`,因为它会自动发现 IDF action 扩展。
9498
9599
如果遇到任何问题,请参考 [## 故障排除](#故障排除) 部分。
96100

@@ -216,6 +220,9 @@ Board Manager 的设备名称推荐用于用户项目,而外设名称不推荐
216220
#### 创建板级文件夹和文件
217221
218222
1. **创建板级目录**
223+
- 推荐板级目录放置在项目的 components 文件下,路径可参考: `esp_board_manager/test_apps/components/board_customer`
224+
- 板级目录还可以放在其他位置,路径参考:`esp_board_manager/test_apps/test_custom_boards` 和 `esp_board_manager/test_apps/test_single_board`。这个路径运行命令时需要添加 `-c` 参数来指定路径,如 `test_apps` 下:`idf.py gen-bmgr-config -c test_single_board -l`
225+
219226
```bash
220227
mkdir boards/<board_name>
221228
cd boards/<board_name>
@@ -247,6 +254,9 @@ Board Manager 的设备名称推荐用于用户项目,而外设名称不推荐
247254
```
248255
249256
5. **定义外设**
257+
- 寻找 `boards` 中相似的外设配置YML文件进行参考
258+
- 基于 `peripherals` 下支持的外设 YML 进行配置
259+
每个外设的基本结构如下:
250260
```yaml
251261
# board_peripherals.yaml
252262
board: <board_name>
@@ -262,6 +272,9 @@ Board Manager 的设备名称推荐用于用户项目,而外设名称不推荐
262272
```
263273

264274
6. **定义设备**
275+
- 寻找 `boards` 中相似的设备配置YML文件进行参考
276+
- 基于 `devices` 下支持的设备 YML 进行配置
277+
每个设备的基本结构如下:
265278
```yaml
266279
# board_devices.yaml
267280
board: <board_name>
@@ -285,6 +298,14 @@ Board Manager 的设备名称推荐用于用户项目,而外设名称不推荐
285298
peripherals:
286299
- name: <peripheral_name>
287300
```
301+
7. **`board` 目录中自定义代码的说明**
302+
- 在使用一些设备的时候,需要额外增加自定义代码,比如 `display_lcd`, `lcd_touch` and `custom` device.
303+
- 这是为了提高板子的适配,让用户根据自己板子情况选择 device 实际初始化函数,`display_lcd`, `lcd_touch` 参考 `esp_board_manager/boards/echoear_core_board_v1_2/setup_device.c`。
304+
305+
8. **`custom` 自定义设备说明**
306+
- 对于 esp_board_manager 还未包含的设备和外设,建议通过 `custom` 类型 device 进行添加
307+
- 实现的代码放置在 `board` 目录下,参考 `esp_board_manager/boards/esp32_s3_korvo2l/custom_device.c`
308+
- 当该 board 被选择后 `gen_bmgr_codes` 目录下会生成 `gen_board_device_custom.h` 头文件,供应用程序使用
288309

289310
> **⚙️ 关于 `dependencies` 使用说明**
290311
>
@@ -382,9 +403,9 @@ ESP Board Manager 支持通过三个不同的路径位置进行板级配置,
382403
| SPIFFS 文件系统 | fs_spiffs | - | - | ✅ 支持 | SPIFFS 文件系统 | [`dev_fs_spiffs.yaml`](devices/dev_fs_spiffs/dev_fs_spiffs.yaml) |
383404
| GPIO 控制 | gpio_ctrl | - | gpio | ✅ 支持 | GPIO 控制设备 | [`dev_gpio_ctrl.yaml`](devices/dev_gpio_ctrl/dev_gpio_ctrl.yaml) |
384405
| LEDC 控制 | ledc_ctrl | - | ledc | ✅ 支持 | LEDC 控制设备 | [`dev_ledc_ctrl.yaml`](devices/dev_ledc_ctrl/dev_ledc_ctrl.yaml) |
385-
| [自定义设备](devices/dev_custom/README.md | custom | - | any | ✅ 支持 | 用户定义的自定义设备 | [`dev_custom.yaml`](devices/dev_custom/dev_custom.yaml) |
406+
| [自定义设备](devices/dev_custom/README.md) | custom | - | any | ✅ 支持 | 用户定义的自定义设备 | [`dev_custom.yaml`](devices/dev_custom/dev_custom.yaml) |
386407
| GPIO 扩展芯片 | gpio_expander | TCA9554/TCA95XX/HT8574 | i2c | ✅ 支持 | GPIO 扩展芯片 | [`dev_gpio_expander.yaml`](devices/dev_gpio_expander/dev_gpio_expander.yaml) |
387-
| 摄像头 | camera | - | i2c | ✅ 支持 | 摄像头设备 | [`dev_gpio_expander.yaml`](devices/dev_camera/dev_camera.yaml) |
408+
| 摄像头 | camera | - | i2c | ✅ 支持 | 摄像头设备 | [`dev_camera.yaml`](devices/dev_camera/dev_camera.yaml) |
388409

389410
### 支持的板级
390411

@@ -562,14 +583,14 @@ python gen_bmgr_config_codes.py --sdkconfig-only
562583

563584
## 路线图
564585

565-
ESP Board Manager 的未来开发计划:
566-
- **构建工作流程**: 提高效率并简化构建工作流程
586+
ESP Board Manager 的未来开发计划(优先级从高到低):
587+
- **支持更多外设和设备**: 添加更多外设、设备和板级
588+
- **Web 可视化配置**: 结合大模型通过网页实现可视化和智能化的配置板子
589+
- **完善文档**: 增加更多说明文档,如建立明确的规则以促进客户添加外设和设备
590+
- **增强验证**: 全面的 YAML 格式检查、模式验证、输入验证和增强的规则验证
591+
- **增强数据结构**: 增强数据或 YAML 结构以提高性能
567592
- **版本管理**: 支持设备和外设的不同版本代码和解析器
568593
- **插件架构**: 用于自定义设备和外设支持的可扩展插件系统
569-
- **增强验证**: 全面的 YAML 格式检查、模式验证、输入验证和增强的规则验证,具有改进的错误报告
570-
- **增强初始化流程**: 支持跳过特定组件或在不同核心上调用初始化
571-
- **明确定义规则**: 建立明确的规则以促进客户添加外设和设备
572-
- **扩展组件支持**: 添加更多外设、设备和板级
573594

574595
## 故障排除
575596

packages/esp_board_manager/boards/esp32_s3_korvo2_v3/board_devices.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ devices:
5454
clk: 15 # GPIO_NUM_15
5555
cmd: 7 # GPIO_NUM_7
5656
d0: 4 # GPIO_NUM_4
57-
57+
5858
- name: gpio_expander
5959
chip: tca9554
6060
type: gpio_expander
@@ -68,7 +68,7 @@ devices:
6868
input_io_mask: NULL
6969
peripherals:
7070
- name: i2c_master
71-
i2c_addr: [0x70, 0x7A] # I2C address of the IO expander
71+
i2c_addr: [0x70, 0x40] # I2C address of the IO expander
7272

7373
- name: display_lcd
7474
chip: ili9341

packages/esp_board_manager/boards/esp32_s3_korvo2_v3/setup_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ esp_err_t camera_factory_entry_t(const dev_camera_config_t *camera_cfg, dev_came
8787
ESP_LOGI(TAG, "Creating camera driver...");
8888

8989
void *i2c_handle = NULL;
90-
esp_err_t ret = esp_board_periph_get_handle(camera_cfg->config.dvp.i2c_name, &i2c_handle);
90+
esp_err_t ret = esp_board_periph_ref_handle(camera_cfg->config.dvp.i2c_name, &i2c_handle);
9191
if (ret != ESP_OK || !i2c_handle) {
9292
ESP_LOGE(TAG, "Failed to get I2C handle\n");
9393
return -1;

packages/esp_board_manager/devices/dev_audio_codec/dev_audio_codec.c

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "esp_board_periph.h"
1515
#include "esp_board_manager_defs.h"
1616
#include "es8389_codec.h"
17+
#include "esp_board_device.h"
1718

1819
static const char *TAG = "DEV_AUDIO_CODEC";
1920

@@ -234,12 +235,12 @@ int dev_audio_codec_init(void *cfg, int cfg_size, void **device_handle)
234235
audio_codec_i2s_cfg_t i2s_cfg = {0};
235236
if (strcmp(codec_cfg->name, ESP_BOARD_DEVICE_NAME_AUDIO_ADC) == 0) {
236237
ESP_LOGI(TAG, "ADC is ENABLED");
237-
esp_board_periph_get_handle(codec_cfg->i2s_cfg.name, &i2s_cfg.rx_handle);
238+
esp_board_periph_ref_handle(codec_cfg->i2s_cfg.name, &i2s_cfg.rx_handle);
238239

239240
dev_type |= ESP_CODEC_DEV_TYPE_IN;
240241
} else if (strcmp(codec_cfg->name, ESP_BOARD_DEVICE_NAME_AUDIO_DAC) == 0) {
241242
codec_handles->gpio_if = (audio_codec_gpio_if_t *)audio_codec_new_gpio();
242-
esp_board_periph_get_handle(codec_cfg->i2s_cfg.name, &i2s_cfg.tx_handle);
243+
esp_board_periph_ref_handle(codec_cfg->i2s_cfg.name, &i2s_cfg.tx_handle);
243244
ESP_LOGI(TAG, "DAC is ENABLED");
244245
dev_type |= ESP_CODEC_DEV_TYPE_OUT;
245246
}
@@ -249,7 +250,7 @@ int dev_audio_codec_init(void *cfg, int cfg_size, void **device_handle)
249250
codec_cfg->name, codec_cfg->i2s_cfg.name, i2s_cfg.rx_handle, i2s_cfg.tx_handle, codec_handles->data_if);
250251

251252
audio_codec_i2c_cfg_t i2c_cfg = {0};
252-
esp_board_periph_get_handle(codec_cfg->i2c_cfg.name, &i2c_cfg.bus_handle);
253+
esp_board_periph_ref_handle(codec_cfg->i2c_cfg.name, &i2c_cfg.bus_handle);
253254
i2c_cfg.addr = codec_cfg->i2c_cfg.address;
254255
codec_handles->ctrl_if = (audio_codec_ctrl_if_t *)audio_codec_new_i2c_ctrl(&i2c_cfg);
255256

@@ -300,6 +301,7 @@ int dev_audio_codec_init(void *cfg, int cfg_size, void **device_handle)
300301
int dev_audio_codec_deinit(void *device_handle)
301302
{
302303
dev_audio_codec_handles_t *codec_handles = (dev_audio_codec_handles_t *)device_handle;
304+
303305
esp_codec_dev_delete(codec_handles->codec_dev);
304306
codec_handles->codec_dev = NULL;
305307
audio_codec_delete_codec_if(codec_handles->codec_if);
@@ -311,6 +313,19 @@ int dev_audio_codec_deinit(void *device_handle)
311313
codec_handles->gpio_if = NULL;
312314
}
313315
audio_codec_delete_data_if(codec_handles->data_if);
316+
317+
const char *name = NULL;
318+
const esp_board_device_handle_t *device_handle_struct = esp_board_device_find_by_handle(device_handle);
319+
if (device_handle_struct) {
320+
name = device_handle_struct->name;
321+
}
322+
dev_audio_codec_config_t *cfg = NULL;
323+
esp_board_device_get_config(name, (void **)&cfg);
324+
if (cfg) {
325+
esp_board_periph_unref_handle(cfg->i2s_cfg.name);
326+
esp_board_periph_unref_handle(cfg->i2c_cfg.name);
327+
}
328+
314329
codec_handles->data_if = NULL;
315330
free(codec_handles);
316331
return 0;

packages/esp_board_manager/devices/dev_camera/dev_camera.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include "esp_log.h"
1010
#include "esp_video_init.h"
1111
#include "dev_camera.h"
12+
#include "esp_board_device.h"
13+
#include "esp_board_periph.h"
1214

1315
static const char *TAG = "DEV_CAMERA";
1416

@@ -47,6 +49,18 @@ int dev_camera_deinit(void *device_handle)
4749
}
4850
dev_camera_handle_t *camera_handles = (dev_camera_handle_t *)device_handle;
4951
esp_video_deinit();
52+
53+
const char *name = NULL;
54+
const esp_board_device_handle_t *device_handle_struct = esp_board_device_find_by_handle(device_handle);
55+
if (device_handle_struct) {
56+
name = device_handle_struct->name;
57+
}
58+
dev_camera_config_t *cfg = NULL;
59+
esp_board_device_get_config(name, (void **)&cfg);
60+
if (cfg) {
61+
esp_board_periph_unref_handle(cfg->config.dvp.i2c_name);
62+
}
63+
5064
free(camera_handles);
5165
return 0;
5266
}

0 commit comments

Comments
 (0)