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 }