From eef479a9e927f19d82d3ce812701eb89cf6f877a Mon Sep 17 00:00:00 2001 From: Peter Marcisovsky Date: Wed, 10 Jan 2024 11:17:04 +0100 Subject: [PATCH] fix(usb/host): Fix build C++ build for newly added enum filter feature --- usb/esp_modem_usb_dte/CHANGELOG.md | 4 ++++ usb/esp_modem_usb_dte/esp_modem_usb.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/usb/esp_modem_usb_dte/CHANGELOG.md b/usb/esp_modem_usb_dte/CHANGELOG.md index 61f4f99760..46f9e7ad39 100644 --- a/usb/esp_modem_usb_dte/CHANGELOG.md +++ b/usb/esp_modem_usb_dte/CHANGELOG.md @@ -8,3 +8,7 @@ - Provide default configurations for tested modems - Fix USB receive path bug, where received data could be overwritten by new data - Initial support for modems with two AT ports + +## Unreleased + +- Fix C++ build error for `usb_host_config_t` backward compatibility diff --git a/usb/esp_modem_usb_dte/esp_modem_usb.cpp b/usb/esp_modem_usb_dte/esp_modem_usb.cpp index 4c5bd1b28b..16c93ef5ea 100644 --- a/usb/esp_modem_usb_dte/esp_modem_usb.cpp +++ b/usb/esp_modem_usb_dte/esp_modem_usb.cpp @@ -53,10 +53,10 @@ class UsbTerminal : public Terminal, private CdcAcmDevice { // Install USB Host driver (if not already installed) if (usb_config->install_usb_host && !usb_host_lib_task) { - const usb_host_config_t host_config = { - .skip_phy_setup = false, - .intr_flags = ESP_INTR_FLAG_LEVEL1, - }; + usb_host_config_t host_config = {}; + host_config.skip_phy_setup = false; + host_config.intr_flags = ESP_INTR_FLAG_LEVEL1; + ESP_MODEM_THROW_IF_ERROR(usb_host_install(&host_config), "USB Host install failed"); ESP_LOGD(TAG, "USB Host installed"); ESP_MODEM_THROW_IF_FALSE(