|
|
@ -433,7 +433,7 @@
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint | ENDPOINT_DIR_IN);
|
|
|
|
Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint | ENDPOINT_DIR_IN);
|
|
|
|
|
|
|
|
|
|
|
|
return ((USB_Endpoint_SelectedHandle->STATUS & USB_EP_TRNCOMPL0_bm) ? true : false);
|
|
|
|
return ((USB_Endpoint_SelectedHandle->STATUS & USB_EP_BUSNACK0_bm) ? true : false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** Determines if the selected OUT endpoint has received new packet from the host.
|
|
|
|
/** Determines if the selected OUT endpoint has received new packet from the host.
|
|
|
@ -486,7 +486,13 @@
|
|
|
|
static inline void Endpoint_ClearSETUP(void) ATTR_ALWAYS_INLINE;
|
|
|
|
static inline void Endpoint_ClearSETUP(void) ATTR_ALWAYS_INLINE;
|
|
|
|
static inline void Endpoint_ClearSETUP(void)
|
|
|
|
static inline void Endpoint_ClearSETUP(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
USB_Endpoint_SelectedHandle->STATUS &= ~(USB_EP_SETUP_bm | USB_EP_BUSNACK0_bm);
|
|
|
|
USB_Endpoint_SelectedHandle->STATUS &= ~(USB_EP_SETUP_bm | USB_EP_TRNCOMPL0_bm | USB_EP_BUSNACK0_bm | USB_EP_OVF_bm);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
USB_Endpoint_SelectedHandle->STATUS |= USB_EP_TOGGLE_bm;
|
|
|
|
|
|
|
|
USB_Endpoint_SelectedFIFO->Position = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint | ENDPOINT_DIR_IN);
|
|
|
|
|
|
|
|
USB_Endpoint_SelectedHandle->STATUS |= USB_EP_TOGGLE_bm;
|
|
|
|
USB_Endpoint_SelectedFIFO->Position = 0;
|
|
|
|
USB_Endpoint_SelectedFIFO->Position = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -529,7 +535,14 @@
|
|
|
|
static inline void Endpoint_StallTransaction(void) ATTR_ALWAYS_INLINE;
|
|
|
|
static inline void Endpoint_StallTransaction(void) ATTR_ALWAYS_INLINE;
|
|
|
|
static inline void Endpoint_StallTransaction(void)
|
|
|
|
static inline void Endpoint_StallTransaction(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
USB_Endpoint_SelectedHandle->CTRL |= USB_EP_STALL_bm;
|
|
|
|
USB_Endpoint_SelectedHandle->CTRL |= USB_EP_STALL_bm;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((USB_Endpoint_SelectedHandle->CTRL & USB_EP_TYPE_gm) == USB_EP_TYPE_CONTROL_gc)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint | ENDPOINT_DIR_IN);
|
|
|
|
|
|
|
|
USB_Endpoint_SelectedHandle->STATUS |= USB_EP_STALL_bm;
|
|
|
|
|
|
|
|
Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint & ~ENDPOINT_DIR_IN);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** Clears the STALL condition on the currently selected endpoint.
|
|
|
|
/** Clears the STALL condition on the currently selected endpoint.
|
|
|
@ -551,7 +564,7 @@
|
|
|
|
static inline bool Endpoint_IsStalled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
|
|
|
static inline bool Endpoint_IsStalled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
|
|
|
static inline bool Endpoint_IsStalled(void)
|
|
|
|
static inline bool Endpoint_IsStalled(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return ((USB_Endpoint_SelectedHandle->CTRL & USB_EP_STALL_bm) ? true : false);
|
|
|
|
return ((USB_Endpoint_SelectedHandle->CTRL & USB_EP_STALLF_bm) ? true : false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** Resets the data toggle of the currently selected endpoint. */
|
|
|
|
/** Resets the data toggle of the currently selected endpoint. */
|
|
|
|