mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +03:00
Fixed build for F7.
This commit is contained in:
parent
39a38fd951
commit
24bbb524f6
3 changed files with 13 additions and 4 deletions
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
#include "drivers/serial.h"
|
#include "drivers/serial.h"
|
||||||
|
|
||||||
|
#include "vcp_hal/usbd_cdc_interface.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
serialPort_t port;
|
serialPort_t port;
|
||||||
|
|
||||||
|
@ -32,6 +34,8 @@ typedef struct {
|
||||||
bool buffering;
|
bool buffering;
|
||||||
} vcpPort_t;
|
} vcpPort_t;
|
||||||
|
|
||||||
|
extern USBD_HandleTypeDef USBD_Device;
|
||||||
|
|
||||||
serialPort_t *usbVcpOpen(void);
|
serialPort_t *usbVcpOpen(void);
|
||||||
struct serialPort_s;
|
struct serialPort_s;
|
||||||
uint32_t usbVcpGetBaudRate(struct serialPort_s *instance);
|
uint32_t usbVcpGetBaudRate(struct serialPort_s *instance);
|
||||||
|
|
|
@ -29,12 +29,15 @@
|
||||||
#include "rx/rx.h"
|
#include "rx/rx.h"
|
||||||
|
|
||||||
//TODO: Make it platform independent in the future
|
//TODO: Make it platform independent in the future
|
||||||
#ifdef STM32F4
|
#if defined(STM32F4)
|
||||||
#include "vcpf4/usbd_cdc_vcp.h"
|
#include "vcpf4/usbd_cdc_vcp.h"
|
||||||
|
|
||||||
#include "usbd_hid_core.h"
|
#include "usbd_hid_core.h"
|
||||||
#elif defined(STM32F7)
|
#elif defined(STM32F7)
|
||||||
#include "usbd_cdc_interface.h"
|
#include "drivers/serial_usb_vcp.h"
|
||||||
#include "usbd_def.h"
|
|
||||||
|
#include "vcp_hal/usbd_cdc_interface.h"
|
||||||
|
|
||||||
#include "usbd_hid.h"
|
#include "usbd_hid.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -67,7 +70,7 @@ void sendRcDataToHid(void)
|
||||||
report[i] = -report[i];
|
report[i] = -report[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef STM32F4
|
#if defined(STM32F4)
|
||||||
USBD_HID_SendReport(&USB_OTG_dev, (uint8_t*)report, sizeof(report));
|
USBD_HID_SendReport(&USB_OTG_dev, (uint8_t*)report, sizeof(report));
|
||||||
#elif defined(STM32F7)
|
#elif defined(STM32F7)
|
||||||
USBD_HID_SendReport(&USBD_Device, (uint8_t*)report, sizeof(report));
|
USBD_HID_SendReport(&USBD_Device, (uint8_t*)report, sizeof(report));
|
||||||
|
|
|
@ -53,6 +53,8 @@
|
||||||
#include "usbd_cdc.h"
|
#include "usbd_cdc.h"
|
||||||
#include "usbd_cdc_interface.h"
|
#include "usbd_cdc_interface.h"
|
||||||
#include "stdbool.h"
|
#include "stdbool.h"
|
||||||
|
|
||||||
|
#include "drivers/serial_usb_vcp.h"
|
||||||
#include "drivers/time.h"
|
#include "drivers/time.h"
|
||||||
|
|
||||||
/* Private typedef -----------------------------------------------------------*/
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue