1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 06:15:16 +03:00

[H7][USB] Add transmit complete callback in USBD_CDC_fops

This commit is contained in:
jflyper 2020-09-13 12:23:01 +09:00
parent 3762b4cf6c
commit 0423ad826a

View file

@ -104,6 +104,13 @@ static int8_t CDC_Itf_DeInit(void);
static int8_t CDC_Itf_Control(uint8_t cmd, uint8_t* pbuf, uint16_t length); static int8_t CDC_Itf_Control(uint8_t cmd, uint8_t* pbuf, uint16_t length);
static int8_t CDC_Itf_Receive(uint8_t* pbuf, uint32_t *Len); static int8_t CDC_Itf_Receive(uint8_t* pbuf, uint32_t *Len);
// The CDC_Itf_TransmitCplt field was introduced in MiddleWare that comes with
// H7 V1.8.0.
// Other MCU can be add here as the MiddleWare version advances.
#ifdef STM32H7
static int8_t CDC_Itf_TransmitCplt(uint8_t *Buf, uint32_t *Len, uint8_t epnum);
#endif
static void TIM_Config(void); static void TIM_Config(void);
static void Error_Handler(void); static void Error_Handler(void);
@ -112,7 +119,10 @@ USBD_CDC_ItfTypeDef USBD_CDC_fops =
CDC_Itf_Init, CDC_Itf_Init,
CDC_Itf_DeInit, CDC_Itf_DeInit,
CDC_Itf_Control, CDC_Itf_Control,
CDC_Itf_Receive CDC_Itf_Receive,
#ifdef STM32H7
CDC_Itf_TransmitCplt
#endif
}; };
@ -315,6 +325,17 @@ static int8_t CDC_Itf_Receive(uint8_t* Buf, uint32_t *Len)
return (USBD_OK); return (USBD_OK);
} }
#ifdef STM32H7
static int8_t CDC_Itf_TransmitCplt(uint8_t *Buf, uint32_t *Len, uint8_t epnum)
{
UNUSED(Buf);
UNUSED(Len);
UNUSED(epnum);
return (USBD_OK);
}
#endif
/** /**
* @brief TIM_Config: Configure TIMusb timer * @brief TIM_Config: Configure TIMusb timer
* @param None. * @param None.