Projectkk2glider/issue 4479 slow joystick (#4569)

* Missing debug timer

* USB driver cleanup

* Re #4479: Joystick update called from mixer thread every 10ms

* Cosmetics

* Compilation fix

* Cosmetics

* Another compilation fix
This commit is contained in:
Damjan Adamic
2017-03-07 22:59:32 +01:00
committed by Bertrand Songis
parent 15a373c1cd
commit 03b65b06b6
12 changed files with 136 additions and 161 deletions
@@ -1,23 +1,23 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* 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.
*/
/*
* Copyright (C) OpenTX
*
* Based on code named
* 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.
*/
/* Includes ------------------------------------------------------------------*/
#include "usbd_desc.h"
#include "usbd_hid_core.h"
@@ -385,25 +385,24 @@ static uint8_t USBD_HID_Setup (void *pdev,
/**
* @brief USBD_HID_SendReport
* Send HID Report
* @brief USBD_HID_SendReport
* Send HID Report if TX buffer is free and USB device is configured.
* @param pdev: device instance
* @param buff: pointer to report
* @param buff: pointer to report, if this parameter is NULL then function just test if new buffer can be sent
* @retval status
*/
uint8_t USBD_HID_SendReport (USB_OTG_CORE_HANDLE *pdev,
uint8_t *report,
uint16_t len)
uint8_t USBD_HID_SendReport(USB_OTG_CORE_HANDLE *pdev, uint8_t * report, uint16_t len)
{
if (pdev->dev.device_status == USB_OTG_CONFIGURED )
{
if ( ReportSent )
{
ReportSent = 0;
DCD_EP_Tx (pdev, HID_IN_EP, report, len);
if (pdev->dev.device_status == USB_OTG_CONFIGURED) {
if (ReportSent) {
if (report) {
ReportSent = 0;
DCD_EP_Tx (pdev, HID_IN_EP, report, len);
}
return USBD_OK;
}
}
return USBD_OK;
return USBD_FAIL;
}
/**
@@ -425,6 +424,9 @@ static const uint8_t *USBD_HID_GetCfgDesc (uint8_t speed, uint16_t *length)
* @param pdev: device instance
* @param epnum: endpoint index
* @retval status
This function is called when buffer has been sent over the USB.
The TX buffer is now empty and can be filled with new data.
*/
static uint8_t USBD_HID_DataIn (void *pdev,
uint8_t epnum)