mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Add CDC+HID on F7 (#5596)
This commit is contained in:
parent
c091fa8e48
commit
a9136e2ba0
19 changed files with 1211 additions and 779 deletions
|
@ -87,8 +87,13 @@
|
|||
|
||||
#ifdef USE_USB_CDC_HID
|
||||
//TODO: Make it platform independent in the future
|
||||
#ifdef STM32F4
|
||||
#include "vcpf4/usbd_cdc_vcp.h"
|
||||
#include "usbd_hid_core.h"
|
||||
#elif defined(STM32F7)
|
||||
#include "usbd_cdc_interface.h"
|
||||
#include "usbd_hid.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_BST
|
||||
|
@ -151,7 +156,12 @@ static void taskUpdateRxMain(timeUs_t currentTimeUs)
|
|||
for (int i = 0; i < 8; i++) {
|
||||
report[i] = scaleRange(constrain(rcData[i], 1000, 2000), 1000, 2000, -127, 127);
|
||||
}
|
||||
#ifdef STM32F4
|
||||
USBD_HID_SendReport(&USB_OTG_dev, (uint8_t*)report, sizeof(report));
|
||||
#elif defined(STM32F7)
|
||||
extern USBD_HandleTypeDef USBD_Device;
|
||||
USBD_HID_SendReport(&USBD_Device, (uint8_t*)report, sizeof(report));
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue