From 3c26583a5c82f18acc117bf336e0015d5ce69efc Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Sat, 9 Oct 2021 20:23:16 +0300 Subject: [PATCH] Fix build error when compiling with verbose logging When compiling with verbose logging, the build would error with a message saying `len` is not defined in `tud_vendor_rx_cb()`. This change fixes the error. --- libraries/USB/src/USBVendor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/USB/src/USBVendor.cpp b/libraries/USB/src/USBVendor.cpp index c68568d57ae..8882e32c0c5 100644 --- a/libraries/USB/src/USBVendor.cpp +++ b/libraries/USB/src/USBVendor.cpp @@ -40,8 +40,8 @@ uint16_t tusb_vendor_load_descriptor(uint8_t * dst, uint8_t * itf) } void tud_vendor_rx_cb(uint8_t itf){ - log_v("%u", len); size_t len = tud_vendor_n_available(itf); + log_v("%u", len); if(len){ uint8_t buffer[len]; len = tud_vendor_n_read(itf, buffer, len);