mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Fixed USB HID channel mapping in Windows.
This commit is contained in:
parent
a5ba01666b
commit
444e5c43a5
6 changed files with 104 additions and 22 deletions
|
@ -69,6 +69,7 @@
|
|||
#include "io/transponder_ir.h"
|
||||
#include "io/vtx_tramp.h" // Will be gone
|
||||
#include "io/rcdevice_cam.h"
|
||||
#include "io/usb_cdc_hid.h"
|
||||
#include "io/vtx.h"
|
||||
|
||||
#include "msp/msp_serial.h"
|
||||
|
@ -91,17 +92,6 @@
|
|||
|
||||
#include "telemetry/telemetry.h"
|
||||
|
||||
#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
|
||||
void taskBstMasterProcess(timeUs_t currentTimeUs);
|
||||
#endif
|
||||
|
@ -161,16 +151,7 @@ static void taskUpdateRxMain(timeUs_t currentTimeUs)
|
|||
|
||||
#ifdef USE_USB_CDC_HID
|
||||
if (!ARMING_FLAG(ARMED)) {
|
||||
int8_t report[8];
|
||||
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
|
||||
sendRcDataToHid();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue