2nd attempt to fix #161

This commit is contained in:
hathach
2019-10-01 22:19:04 +07:00
parent 6479ee53d5
commit 204791b3e7
3 changed files with 28 additions and 14 deletions

View File

@@ -47,10 +47,21 @@ bool usbd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t
// Check if endpoint transferring is complete
bool usbd_edpt_busy(uint8_t rhport, uint8_t ep_addr);
// Stall endpoint
void usbd_edpt_stall(uint8_t rhport, uint8_t ep_addr);
// Clear stalled endpoint
void usbd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr);
// Check if endpoint is stalled
bool usbd_edpt_stalled(uint8_t rhport, uint8_t ep_addr);
static inline
bool usbd_edpt_ready(uint8_t rhport, uint8_t ep_addr)
{
return !usbd_edpt_busy(rhport, ep_addr) && !usbd_edpt_stalled(rhport, ep_addr);
}
/*------------------------------------------------------------------*/
/* Helper
*------------------------------------------------------------------*/