From e62cc6552da9fa65ddd45021f71494af9f04a6fe Mon Sep 17 00:00:00 2001 From: jflyper Date: Wed, 8 May 2019 11:59:23 +0900 Subject: [PATCH] [F7] Move non-library CDC-HID code out of lib tree --- make/mcu/STM32F7.mk | 8 ++--- .../Src => src/main/vcp_hal}/usbd_cdc_hid.c | 31 +++++++++++-------- 2 files changed, 20 insertions(+), 19 deletions(-) rename {lib/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_HID/Src => src/main/vcp_hal}/usbd_cdc_hid.c (94%) diff --git a/make/mcu/STM32F7.mk b/make/mcu/STM32F7.mk index 437bf67fb4b..cd1f2da5fb7 100644 --- a/make/mcu/STM32F7.mk +++ b/make/mcu/STM32F7.mk @@ -83,21 +83,17 @@ USBCDC_SRC := $(filter-out ${EXCLUDES}, $(USBCDC_SRC)) USBHID_DIR = $(ROOT)/lib/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/HID USBHID_SRC = $(notdir $(wildcard $(USBHID_DIR)/Src/*.c)) -USBHIDCDC_DIR = $(ROOT)/lib/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_HID -USBHIDCDC_SRC = $(notdir $(wildcard $(USBHIDCDC_DIR)/Src/*.c)) - USBMSC_DIR = $(ROOT)/lib/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/MSC USBMSC_SRC = $(notdir $(wildcard $(USBMSC_DIR)/Src/*.c)) EXCLUDES = usbd_msc_storage_template.c USBMSC_SRC := $(filter-out ${EXCLUDES}, $(USBMSC_SRC)) -VPATH := $(VPATH):$(USBCDC_DIR)/Src:$(USBCORE_DIR)/Src:$(USBHID_DIR)/Src:$(USBHIDCDC_DIR)/Src:$(USBMSC_DIR)/Src +VPATH := $(VPATH):$(USBCDC_DIR)/Src:$(USBCORE_DIR)/Src:$(USBHID_DIR)/Src:$(USBMSC_DIR)/Src DEVICE_STDPERIPH_SRC := $(STDPERIPH_SRC) \ $(USBCORE_SRC) \ $(USBCDC_SRC) \ $(USBHID_SRC) \ - $(USBHIDCDC_SRC) \ $(USBMSC_SRC) #CMSIS @@ -109,7 +105,6 @@ INCLUDE_DIRS := $(INCLUDE_DIRS) \ $(USBCORE_DIR)/Inc \ $(USBCDC_DIR)/Inc \ $(USBHID_DIR)/Inc \ - $(USBHIDCDC_DIR)/Inc \ $(USBMSC_DIR)/Inc \ $(CMSIS_DIR)/Core/Include \ $(ROOT)/lib/main/STM32F7/Drivers/CMSIS/Device/ST/STM32F7xx/Include \ @@ -163,6 +158,7 @@ TARGET_FLAGS = -D$(TARGET) VCP_SRC = \ vcp_hal/usbd_desc.c \ vcp_hal/usbd_conf.c \ + vcp_hal/usbd_cdc_hid.c \ vcp_hal/usbd_cdc_interface.c \ drivers/serial_usb_vcp.c \ drivers/usb_io.c diff --git a/lib/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_HID/Src/usbd_cdc_hid.c b/src/main/vcp_hal/usbd_cdc_hid.c similarity index 94% rename from lib/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_HID/Src/usbd_cdc_hid.c rename to src/main/vcp_hal/usbd_cdc_hid.c index 5baa7a7c6d5..163912d4ff4 100644 --- a/lib/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_HID/Src/usbd_cdc_hid.c +++ b/src/main/vcp_hal/usbd_cdc_hid.c @@ -1,23 +1,30 @@ /* - * This file is part of Cleanflight. + * This file is part of Cleanflight and Betaflight. * - * Cleanflight is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * Cleanflight and Betaflight are free software. You can redistribute + * this software and/or modify this software under the terms of the + * GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) + * any later version. * - * Cleanflight is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Cleanflight and Betaflight are distributed in the hope that they + * will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Cleanflight. If not, see . + * along with this software. + * + * If not, see . * * Author: Chris Hockuba (https://github.com/conkerkh) * */ +#include "platform.h" + +#ifdef USE_USB_CDC_HID + //#include "usbd_cdc_hid.h" #include "usbd_desc.h" #include "usbd_ctlreq.h" @@ -327,6 +334,4 @@ uint8_t *USBD_HID_CDC_GetDeviceQualifierDescriptor (uint16_t *length) *length = sizeof(USBD_HID_CDC_DeviceQualifierDesc); return USBD_HID_CDC_DeviceQualifierDesc; } - - - +#endif