From e637f2efc466da40aa7c8ddf8cd3c4deb1d66ac1 Mon Sep 17 00:00:00 2001 From: Taylor Yu Date: Sun, 25 Dec 2022 19:09:06 -0600 Subject: [PATCH] add USBCore_::configured --- cores/arduino/USBCore.cpp | 5 +++++ cores/arduino/USBCore.h | 1 + 2 files changed, 6 insertions(+) diff --git a/cores/arduino/USBCore.cpp b/cores/arduino/USBCore.cpp index b68a1ea6..04022478 100644 --- a/cores/arduino/USBCore.cpp +++ b/cores/arduino/USBCore.cpp @@ -994,4 +994,9 @@ bool USBCore_::isSuspended() { return USBCore().usbDev().cur_status == USBD_SUSPENDED; } + +bool USBCore_::configured() +{ + return USBCore().usbDev().config != 0; +} #endif diff --git a/cores/arduino/USBCore.h b/cores/arduino/USBCore.h index 3c34e5d4..ddc7850c 100644 --- a/cores/arduino/USBCore.h +++ b/cores/arduino/USBCore.h @@ -147,6 +147,7 @@ class USBCore_ void connect(); void disconnect(); bool isSuspended(); + bool configured(); /* * PluggableUSB interface.