From 486b7e8274b8e39440d6c63719a31273fec60adb Mon Sep 17 00:00:00 2001 From: Tom Igoe Date: Tue, 4 Oct 2022 19:43:49 -0400 Subject: [PATCH] Fix compilation for SAMD cores based on ArduinoCore-API (#97) Co-authored-by: Martino Facchin --- library/WebUSB/WebUSB.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/WebUSB/WebUSB.h b/library/WebUSB/WebUSB.h index a1628b8..6acd4f6 100755 --- a/library/WebUSB/WebUSB.h +++ b/library/WebUSB/WebUSB.h @@ -22,7 +22,11 @@ #include #include #ifdef ARDUINO_ARCH_SAMD +#ifdef ARDUINO_API_VERSION +#include "api/PluggableUSB.h" +#else #include "USB/PluggableUSB.h" +#endif #else #include "PluggableUSB.h" #include @@ -124,7 +128,11 @@ class WebUSB : public PluggableUSBModule, public Stream bool VendorControlRequest(USBSetup& setup); #ifdef ARDUINO_ARCH_SAMD +#ifdef ARDUINO_API_VERSION + unsigned int epType[2]; +#else uint32_t epType[2]; +#endif #else uint8_t epType[2]; #endif