refactor: USB HAL conversion + USB lib update (#4207)
Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com> Co-authored-by: Richard Li <richard.li@ces.hk>
This commit is contained in:
co-authored by
raphaelcoeffic
Richard Li
parent
a68ad817d7
commit
c9334ebda3
@@ -143,7 +143,6 @@ set(FIRMWARE_TARGET_SRC
|
||||
|
||||
set(FIRMWARE_SRC
|
||||
${FIRMWARE_SRC}
|
||||
targets/common/arm/stm32/diskio_sdio.cpp
|
||||
targets/common/arm/stm32/dma2d.cpp
|
||||
targets/common/arm/stm32/spi_flash.cpp
|
||||
targets/common/arm/stm32/diskio_spi_flash.cpp
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "hal/switch_driver.h"
|
||||
#include "hal/abnormal_reboot.h"
|
||||
#include "hal/watchdog_driver.h"
|
||||
#include "hal/usb_driver.h"
|
||||
|
||||
#include "globals.h"
|
||||
#include "sdcard.h"
|
||||
@@ -47,15 +48,6 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
#endif
|
||||
#include "usb_dcd_int.h"
|
||||
#include "usb_bsp.h"
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
// common ADC driver
|
||||
extern const etx_hal_adc_driver_t _adc_driver;
|
||||
|
||||
|
||||
@@ -192,19 +192,6 @@ bool isBacklightEnabled();
|
||||
: g_eeGeneral.blOffBright); \
|
||||
}
|
||||
|
||||
#if !defined(SIMU)
|
||||
void usbJoystickUpdate();
|
||||
#endif
|
||||
#if (PCBREV == EL18)
|
||||
#define USB_NAME "Flysky EL18"
|
||||
#define USB_MANUFACTURER 'F', 'l', 'y', 's', 'k', 'y', ' ', ' ' /* 8 bytes */
|
||||
#define USB_PRODUCT 'E', 'L', '1', '8', ' ', ' ', ' ', ' ' /* 8 Bytes */
|
||||
#else
|
||||
#define USB_NAME "Flysky NV14"
|
||||
#define USB_MANUFACTURER 'F', 'l', 'y', 's', 'k', 'y', ' ', ' ' /* 8 bytes */
|
||||
#define USB_PRODUCT 'N', 'V', '1', '4', ' ', ' ', ' ', ' ' /* 8 Bytes */
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -256,11 +256,9 @@
|
||||
// USB
|
||||
#define USB_RCC_AHB1Periph_GPIO RCC_AHB1Periph_GPIOA
|
||||
#define USB_GPIO GPIOA
|
||||
#define USB_GPIO_PIN_VBUS GPIO_Pin_9 // PA.09
|
||||
#define USB_GPIO_PIN_DM GPIO_Pin_11 // PA.11
|
||||
#define USB_GPIO_PIN_DP GPIO_Pin_12 // PA.12
|
||||
#define USB_GPIO_PinSource_DM GPIO_PinSource11
|
||||
#define USB_GPIO_PinSource_DP GPIO_PinSource12
|
||||
#define USB_GPIO_PIN_VBUS LL_GPIO_PIN_9 // PA.09
|
||||
#define USB_GPIO_PIN_DM LL_GPIO_PIN_11 // PA.11
|
||||
#define USB_GPIO_PIN_DP LL_GPIO_PIN_12 // PA.12
|
||||
#define USB_GPIO_AF GPIO_AF_OTG1_FS
|
||||
|
||||
#define USB_SW_AHB1Periph_GPIO RCC_AHB1Periph_GPIOI
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program 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.
|
||||
*/
|
||||
|
||||
#ifndef _USB_DESCRIPTOR_H_
|
||||
#define _USB_DESCRIPTOR_H_
|
||||
|
||||
#if (PCBREV == EL18)
|
||||
#define USB_NAME "Flysky EL18"
|
||||
#define USB_MANUFACTURER 'F', 'l', 'y', 's', 'k', 'y', ' ', ' ' /* 8 bytes */
|
||||
#define USB_PRODUCT 'E', 'L', '1', '8', ' ', ' ', ' ', ' ' /* 8 Bytes */
|
||||
#else
|
||||
#define USB_NAME "Flysky NV14"
|
||||
#define USB_MANUFACTURER 'F', 'l', 'y', 's', 'k', 'y', ' ', ' ' /* 8 bytes */
|
||||
#define USB_PRODUCT 'N', 'V', '1', '4', ' ', ' ', ' ', ' ' /* 8 Bytes */
|
||||
#endif
|
||||
|
||||
#endif // _USB_DESCRIPTOR_H_
|
||||
Reference in New Issue
Block a user