From cf5f1be5ffdcdef5c9a1052fe6fb4d3922fa9a31 Mon Sep 17 00:00:00 2001 From: cfif Date: Tue, 7 Apr 2026 15:09:18 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=D1=87=D0=B0=D0=BB=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SerialPort_USB.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SerialPort_USB.c b/SerialPort_USB.c index 5024f04..80832ed 100644 --- a/SerialPort_USB.c +++ b/SerialPort_USB.c @@ -196,6 +196,7 @@ void usb1_gpio_config(void) { } void usb2_gpio_config(void) { +#if (OTG2_USB_ID == 1) gpio_init_type gpio_init_struct; crm_periph_clock_enable(OTG2_PIN_GPIO_CLOCK, TRUE); @@ -212,6 +213,7 @@ void usb2_gpio_config(void) { gpio_pin_mux_config(OTG2_PIN_GPIO, OTG2_PIN_DP_SOURCE, OTG2_PIN_MUX); gpio_pin_mux_config(OTG2_PIN_GPIO, OTG2_PIN_DM_SOURCE, OTG2_PIN_MUX); +#endif #ifdef USB_SOF_OUTPUT_ENABLE crm_periph_clock_enable(OTG_PIN_SOF_GPIO_CLOCK, TRUE); @@ -299,9 +301,11 @@ static uint16_t vSerialPortUsbTransmit(tSerialPortUsbArtery *env, uint8_t *data, } if (env->USB_ID == 2) { +#if (OTG2_USB_ID == 1) if (usb_vcp_send_data(&otg2_core_struct.dev, data, size) == SUCCESS) { return size; } +#endif }