More XMEGA USB AVR device port work - re-add missing Endpoint stream functions, remove unnecessary internal functions.

pull/1469/head
Dean Camera 13 years ago
parent 8629e1918c
commit b971dbbce8

@ -37,7 +37,7 @@
void USB_Device_SendRemoteWakeup(void) void USB_Device_SendRemoteWakeup(void)
{ {
// TODO USB.CTRLB |= USB_RWAKEUP_bm;
} }
#endif #endif

@ -39,13 +39,79 @@
uint8_t Endpoint_Discard_Stream(uint16_t Length, uint8_t Endpoint_Discard_Stream(uint16_t Length,
uint16_t* const BytesProcessed) uint16_t* const BytesProcessed)
{ {
return 0; // TODO uint8_t ErrorCode;
uint16_t BytesInTransfer = 0;
if ((ErrorCode = Endpoint_WaitUntilReady()))
return ErrorCode;
if (BytesProcessed != NULL)
Length -= *BytesProcessed;
while (Length)
{
if (!(Endpoint_IsReadWriteAllowed()))
{
Endpoint_ClearOUT();
if (BytesProcessed != NULL)
{
*BytesProcessed += BytesInTransfer;
return ENDPOINT_RWSTREAM_IncompleteTransfer;
}
if ((ErrorCode = Endpoint_WaitUntilReady()))
return ErrorCode;
}
else
{
Endpoint_Discard_8();
Length--;
BytesInTransfer++;
}
}
return ENDPOINT_RWSTREAM_NoError;
} }
uint8_t Endpoint_Null_Stream(uint16_t Length, uint8_t Endpoint_Null_Stream(uint16_t Length,
uint16_t* const BytesProcessed) uint16_t* const BytesProcessed)
{ {
return 0; // TODO uint8_t ErrorCode;
uint16_t BytesInTransfer = 0;
if ((ErrorCode = Endpoint_WaitUntilReady()))
return ErrorCode;
if (BytesProcessed != NULL)
Length -= *BytesProcessed;
while (Length)
{
if (!(Endpoint_IsReadWriteAllowed()))
{
Endpoint_ClearIN();
if (BytesProcessed != NULL)
{
*BytesProcessed += BytesInTransfer;
return ENDPOINT_RWSTREAM_IncompleteTransfer;
}
if ((ErrorCode = Endpoint_WaitUntilReady()))
return ErrorCode;
}
else
{
Endpoint_Write_8(0);
Length--;
BytesInTransfer++;
}
}
return ENDPOINT_RWSTREAM_NoError;
} }
#define TEMPLATE_FUNC_NAME Endpoint_Write_Stream_LE #define TEMPLATE_FUNC_NAME Endpoint_Write_Stream_LE

@ -95,14 +95,6 @@
#define ENDPOINT_DETAILS_MAXEP 16 #define ENDPOINT_DETAILS_MAXEP 16
/* Inline Functions: */
static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes) ATTR_WARN_UNUSED_RESULT ATTR_CONST
ATTR_ALWAYS_INLINE;
static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes)
{
return 0; // TODO
}
/* Function Prototypes: */ /* Function Prototypes: */
void Endpoint_ClearEndpoints(void); void Endpoint_ClearEndpoints(void);
bool Endpoint_ConfigureEndpoint_Prv(const uint8_t Number, bool Endpoint_ConfigureEndpoint_Prv(const uint8_t Number,

Loading…
Cancel
Save