mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 03:20:00 +03:00
[G4][LIB] Take care of unused parameters in USB library
This commit is contained in:
parent
ddd60b6fbb
commit
a5d08c91c5
6 changed files with 38 additions and 0 deletions
|
@ -470,6 +470,8 @@ __ALIGN_BEGIN uint8_t USBD_CDC_OtherSpeedCfgDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIG
|
|||
*/
|
||||
static uint8_t USBD_CDC_Init (USBD_HandleTypeDef *pdev, uint8_t cfgidx)
|
||||
{
|
||||
UNUSED(cfgidx);
|
||||
|
||||
uint8_t ret = 0U;
|
||||
USBD_CDC_HandleTypeDef *hcdc;
|
||||
|
||||
|
@ -548,6 +550,8 @@ static uint8_t USBD_CDC_Init (USBD_HandleTypeDef *pdev, uint8_t cfgidx)
|
|||
*/
|
||||
static uint8_t USBD_CDC_DeInit (USBD_HandleTypeDef *pdev, uint8_t cfgidx)
|
||||
{
|
||||
UNUSED(cfgidx);
|
||||
|
||||
uint8_t ret = 0U;
|
||||
|
||||
/* Close EP IN */
|
||||
|
|
|
@ -382,6 +382,8 @@ __ALIGN_BEGIN static uint8_t HID_MOUSE_ReportDesc[HID_MOUSE_REPORT_DESC_SIZE] _
|
|||
*/
|
||||
static uint8_t USBD_HID_Init (USBD_HandleTypeDef *pdev, uint8_t cfgidx)
|
||||
{
|
||||
UNUSED(cfgidx);
|
||||
|
||||
/* Open EP IN */
|
||||
USBD_LL_OpenEP(pdev, HID_EPIN_ADDR, USBD_EP_TYPE_INTR, HID_EPIN_SIZE);
|
||||
pdev->ep_in[HID_EPIN_ADDR & 0xFU].is_used = 1U;
|
||||
|
@ -408,6 +410,8 @@ static uint8_t USBD_HID_Init (USBD_HandleTypeDef *pdev, uint8_t cfgidx)
|
|||
static uint8_t USBD_HID_DeInit (USBD_HandleTypeDef *pdev,
|
||||
uint8_t cfgidx)
|
||||
{
|
||||
UNUSED(cfgidx);
|
||||
|
||||
/* Close HID EPs */
|
||||
USBD_LL_CloseEP(pdev, HID_EPIN_ADDR);
|
||||
pdev->ep_in[HID_EPIN_ADDR & 0xFU].is_used = 0U;
|
||||
|
@ -644,6 +648,7 @@ static uint8_t *USBD_HID_GetOtherSpeedCfgDesc (uint16_t *length)
|
|||
static uint8_t USBD_HID_DataIn (USBD_HandleTypeDef *pdev,
|
||||
uint8_t epnum)
|
||||
{
|
||||
UNUSED(epnum);
|
||||
|
||||
/* Ensure that the FIFO is empty before a new transfer, this condition could
|
||||
be caused by a new transfer before the end of the previous transfer */
|
||||
|
|
|
@ -295,6 +295,8 @@ __ALIGN_BEGIN uint8_t USBD_MSC_DeviceQualifierDesc[USB_LEN_DEV_QUALIFIER_DESC]
|
|||
*/
|
||||
uint8_t USBD_MSC_Init (USBD_HandleTypeDef *pdev, uint8_t cfgidx)
|
||||
{
|
||||
UNUSED(cfgidx);
|
||||
|
||||
if(pdev->dev_speed == USBD_SPEED_HIGH)
|
||||
{
|
||||
/* Open EP OUT */
|
||||
|
@ -338,6 +340,8 @@ uint8_t USBD_MSC_Init (USBD_HandleTypeDef *pdev, uint8_t cfgidx)
|
|||
uint8_t USBD_MSC_DeInit (USBD_HandleTypeDef *pdev,
|
||||
uint8_t cfgidx)
|
||||
{
|
||||
UNUSED(cfgidx);
|
||||
|
||||
/* Close MSC EPs */
|
||||
USBD_LL_CloseEP(pdev, MSC_EPOUT_ADDR);
|
||||
pdev->ep_out[MSC_EPOUT_ADDR & 0xFU].is_used = 0U;
|
||||
|
|
|
@ -159,6 +159,8 @@ void MSC_BOT_DeInit (USBD_HandleTypeDef *pdev)
|
|||
void MSC_BOT_DataIn (USBD_HandleTypeDef *pdev,
|
||||
uint8_t epnum)
|
||||
{
|
||||
UNUSED(epnum);
|
||||
|
||||
USBD_MSC_BOT_HandleTypeDef *hmsc = (USBD_MSC_BOT_HandleTypeDef*)pdev->pClassData;
|
||||
|
||||
switch (hmsc->bot_state)
|
||||
|
@ -192,6 +194,8 @@ void MSC_BOT_DataIn (USBD_HandleTypeDef *pdev,
|
|||
void MSC_BOT_DataOut (USBD_HandleTypeDef *pdev,
|
||||
uint8_t epnum)
|
||||
{
|
||||
UNUSED(epnum);
|
||||
|
||||
USBD_MSC_BOT_HandleTypeDef *hmsc = (USBD_MSC_BOT_HandleTypeDef*)pdev->pClassData;
|
||||
|
||||
switch (hmsc->bot_state)
|
||||
|
|
|
@ -180,6 +180,8 @@ int8_t SCSI_ProcessCmd(USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t *cmd)
|
|||
*/
|
||||
static int8_t SCSI_TestUnitReady(USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t *params)
|
||||
{
|
||||
UNUSED(params);
|
||||
|
||||
USBD_MSC_BOT_HandleTypeDef *hmsc = (USBD_MSC_BOT_HandleTypeDef*)pdev->pClassData;
|
||||
|
||||
/* case 9 : Hi > D0 */
|
||||
|
@ -256,6 +258,8 @@ static int8_t SCSI_Inquiry(USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t *par
|
|||
*/
|
||||
static int8_t SCSI_ReadCapacity10(USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t *params)
|
||||
{
|
||||
UNUSED(params);
|
||||
|
||||
USBD_MSC_BOT_HandleTypeDef *hmsc = (USBD_MSC_BOT_HandleTypeDef*)pdev->pClassData;
|
||||
|
||||
if(((USBD_StorageTypeDef *)pdev->pUserData)->GetCapacity(lun, &hmsc->scsi_blk_nbr, &hmsc->scsi_blk_size) != 0)
|
||||
|
@ -289,6 +293,8 @@ static int8_t SCSI_ReadCapacity10(USBD_HandleTypeDef *pdev, uint8_t lun, uint8_
|
|||
*/
|
||||
static int8_t SCSI_ReadFormatCapacity(USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t *params)
|
||||
{
|
||||
UNUSED(params);
|
||||
|
||||
USBD_MSC_BOT_HandleTypeDef *hmsc = (USBD_MSC_BOT_HandleTypeDef*)pdev->pClassData;
|
||||
|
||||
uint16_t blk_size;
|
||||
|
@ -331,6 +337,9 @@ static int8_t SCSI_ReadFormatCapacity(USBD_HandleTypeDef *pdev, uint8_t lun, ui
|
|||
*/
|
||||
static int8_t SCSI_ModeSense6 (USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t *params)
|
||||
{
|
||||
UNUSED(lun);
|
||||
UNUSED(params);
|
||||
|
||||
USBD_MSC_BOT_HandleTypeDef *hmsc = (USBD_MSC_BOT_HandleTypeDef*)pdev->pClassData;
|
||||
uint16_t len = 8U;
|
||||
hmsc->bot_data_length = len;
|
||||
|
@ -352,6 +361,9 @@ static int8_t SCSI_ModeSense6 (USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t *
|
|||
*/
|
||||
static int8_t SCSI_ModeSense10 (USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t *params)
|
||||
{
|
||||
UNUSED(lun);
|
||||
UNUSED(params);
|
||||
|
||||
uint16_t len = 8U;
|
||||
USBD_MSC_BOT_HandleTypeDef *hmsc = (USBD_MSC_BOT_HandleTypeDef*)pdev->pClassData;
|
||||
|
||||
|
@ -376,6 +388,8 @@ static int8_t SCSI_ModeSense10 (USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t
|
|||
|
||||
static int8_t SCSI_RequestSense (USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t *params)
|
||||
{
|
||||
UNUSED(lun);
|
||||
|
||||
uint8_t i;
|
||||
USBD_MSC_BOT_HandleTypeDef *hmsc = (USBD_MSC_BOT_HandleTypeDef*)pdev->pClassData;
|
||||
|
||||
|
@ -419,6 +433,8 @@ static int8_t SCSI_RequestSense (USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t
|
|||
*/
|
||||
void SCSI_SenseCode(USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t sKey, uint8_t ASC)
|
||||
{
|
||||
UNUSED(lun);
|
||||
|
||||
USBD_MSC_BOT_HandleTypeDef *hmsc = (USBD_MSC_BOT_HandleTypeDef*)pdev->pClassData;
|
||||
|
||||
hmsc->scsi_sense[hmsc->scsi_sense_tail].Skey = sKey;
|
||||
|
@ -438,6 +454,9 @@ void SCSI_SenseCode(USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t sKey, uint8_
|
|||
*/
|
||||
static int8_t SCSI_StartStopUnit(USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t *params)
|
||||
{
|
||||
UNUSED(lun);
|
||||
UNUSED(params);
|
||||
|
||||
USBD_MSC_BOT_HandleTypeDef *hmsc = (USBD_MSC_BOT_HandleTypeDef*) pdev->pClassData;
|
||||
hmsc->bot_data_length = 0U;
|
||||
return 0;
|
||||
|
|
|
@ -782,6 +782,8 @@ void USBD_ParseSetupRequest(USBD_SetupReqTypedef *req, uint8_t *pdata)
|
|||
void USBD_CtlError( USBD_HandleTypeDef *pdev ,
|
||||
USBD_SetupReqTypedef *req)
|
||||
{
|
||||
UNUSED(req);
|
||||
|
||||
USBD_LL_StallEP(pdev , 0x80U);
|
||||
USBD_LL_StallEP(pdev , 0U);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue