From 6e82983f86988956c40f5aa47d64e7f486c42068 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Tue, 7 Mar 2023 17:14:15 +0100 Subject: [PATCH] fix(serial): warning Warray-bounds when USB CDC enabled and generic Serial warning: array subscript 'HardwareSerial[0]' is partly outside array bounds of 'USBSerial [1]' [-Warray-bounds] Signed-off-by: Frederic Pillon --- cores/arduino/HardwareSerial.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cores/arduino/HardwareSerial.cpp b/cores/arduino/HardwareSerial.cpp index 3aba60253d..a06a6275eb 100644 --- a/cores/arduino/HardwareSerial.cpp +++ b/cores/arduino/HardwareSerial.cpp @@ -132,6 +132,7 @@ HardwareSerial::HardwareSerial(void *peripheral, HalfDuplexMode_t halfDuplex) // If Serial is defined in variant set // the Rx/Tx pins for com port if defined #if defined(Serial) && defined(PIN_SERIAL_TX) +#if !defined(USBCON) || defined(USBD_USE_CDC) && defined(DISABLE_GENERIC_SERIALUSB) if ((void *)this == (void *)&Serial) { #if defined(PIN_SERIAL_RX) setRx(PIN_SERIAL_RX); @@ -139,6 +140,7 @@ HardwareSerial::HardwareSerial(void *peripheral, HalfDuplexMode_t halfDuplex) setTx(PIN_SERIAL_TX); } else #endif +#endif #if defined(PIN_SERIAL1_TX) && defined(USART1_BASE) if (peripheral == USART1) { #if defined(PIN_SERIAL1_RX) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy