From 14a0990a6f3275df1cfaff5d89b1af6e2480c360 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Wed, 30 Sep 2026 23:54:20 -0400 Subject: [PATCH] chore(usb_device): C++ standard after project(), UsbCdc doc section explains the composite example Post-merge review of #834: the example sets CMAKE_CXX_STANDARD after project() like the ODrive USB example, and the UsbCdc header's example section says the snippet is the composite device (CDC next to vendor + MSC). Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01DFjjnq3XCTRAXENSxsCxJU --- components/usb_device/example/CMakeLists.txt | 3 ++- components/usb_device/include/usb_cdc.hpp | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/components/usb_device/example/CMakeLists.txt b/components/usb_device/example/CMakeLists.txt index 638b88f1c5..c6f1a3bded 100644 --- a/components/usb_device/example/CMakeLists.txt +++ b/components/usb_device/example/CMakeLists.txt @@ -2,7 +2,6 @@ # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.20) -set(CMAKE_CXX_STANDARD 20) # This example needs the managed `espressif/esp_tinyusb` component (required by # usb_device). It supports two build modes: @@ -48,3 +47,5 @@ set( ) project(usb_device_example) + +set(CMAKE_CXX_STANDARD 20) diff --git a/components/usb_device/include/usb_cdc.hpp b/components/usb_device/include/usb_cdc.hpp index 4798fa90c2..d2b512964e 100644 --- a/components/usb_device/include/usb_cdc.hpp +++ b/components/usb_device/include/usb_cdc.hpp @@ -34,6 +34,9 @@ namespace espp { * short and non-blocking; it is safe to call write() from within it. * * \section usb_cdc_ex1 UsbCdc Example + * UsbCdc is the CDC-only subset of espp::UsbDevice; the composite USB device + * example below shows the CDC interface (a framed-protocol link over Web + * Serial) next to the vendor and MSC interfaces. * \snippet usb_device_example.cpp usb_device_example */ class UsbCdc : public BaseComponent {