Commit 899df7d3 authored by Dean Camera's avatar Dean Camera

Renamed all low level Endpoint_Read_*, Endpoint_Write_* and Endpoint_Discard_*...

Renamed all low level Endpoint_Read_*, Endpoint_Write_* and Endpoint_Discard_* functions to use the number of bits instead of a symbolic size (Byte, Word, DWord) so that the function names are applicable and correct across all architectures.

Renamed all low level Pipe_Read_*, Pipe_Write_* and Pipe_Discard_* functions to use the number of bits instead of a symbolic size (Byte, Word, DWord) so that the function names are applicable and correct across all architectures.
parent 2efa79d3
......@@ -301,7 +301,7 @@ static uint8_t FetchNextCommandByte(void)
}
/* Fetch the next byte from the OUT endpoint */
return Endpoint_Read_Byte();
return Endpoint_Read_8();
}
/** Writes the next response byte to the CDC data IN endpoint, and sends the endpoint back if needed to free up the
......@@ -327,7 +327,7 @@ static void WriteNextResponseByte(const uint8_t Response)
}
/* Write the next byte to the IN endpoint */
Endpoint_Write_Byte(Response);
Endpoint_Write_8(Response);
}
/** Task to read in AVR910 commands from the CDC data OUT endpoint, process them, perform the required actions
......
......@@ -203,7 +203,7 @@ void EVENT_USB_Device_ControlRequest(void)
}
/* First byte of the data stage is the DNLOAD request's command */
SentCommand.Command = Endpoint_Read_Byte();
SentCommand.Command = Endpoint_Read_8();
/* One byte of the data stage is the command, so subtract it from the total data bytes */
SentCommand.DataSize--;
......@@ -212,7 +212,7 @@ void EVENT_USB_Device_ControlRequest(void)
for (uint8_t DataByte = 0; (DataByte < sizeof(SentCommand.Data)) &&
Endpoint_BytesInEndpoint(); DataByte++)
{
SentCommand.Data[DataByte] = Endpoint_Read_Byte();
SentCommand.Data[DataByte] = Endpoint_Read_8();
SentCommand.DataSize--;
}
......@@ -267,7 +267,7 @@ void EVENT_USB_Device_ControlRequest(void)
}
/* Write the next word into the current flash page */
boot_page_fill(CurrFlashAddress.Long, Endpoint_Read_Word_LE());
boot_page_fill(CurrFlashAddress.Long, Endpoint_Read_16_LE());
/* Adjust counters */
WordsInFlashPage += 1;
......@@ -316,7 +316,7 @@ void EVENT_USB_Device_ControlRequest(void)
}
/* Read the byte from the USB interface and write to to the EEPROM */
eeprom_write_byte((uint8_t*)StartAddr, Endpoint_Read_Byte());
eeprom_write_byte((uint8_t*)StartAddr, Endpoint_Read_8());
/* Adjust counters */
StartAddr++;
......@@ -348,12 +348,12 @@ void EVENT_USB_Device_ControlRequest(void)
{
/* Blank checking is performed in the DFU_DNLOAD request - if we get here we've told the host
that the memory isn't blank, and the host is requesting the first non-blank address */
Endpoint_Write_Word_LE(StartAddr);
Endpoint_Write_16_LE(StartAddr);
}
else
{
/* Idle state upload - send response to last issued command */
Endpoint_Write_Byte(ResponseByte);
Endpoint_Write_8(ResponseByte);
}
}
else
......@@ -388,9 +388,9 @@ void EVENT_USB_Device_ControlRequest(void)
/* Read the flash word and send it via USB to the host */
#if (FLASHEND > 0xFFFF)
Endpoint_Write_Word_LE(pgm_read_word_far(CurrFlashAddress.Long));
Endpoint_Write_16_LE(pgm_read_word_far(CurrFlashAddress.Long));
#else
Endpoint_Write_Word_LE(pgm_read_word(CurrFlashAddress.Long));
Endpoint_Write_16_LE(pgm_read_word(CurrFlashAddress.Long));
#endif
/* Adjust counters */
......@@ -417,7 +417,7 @@ void EVENT_USB_Device_ControlRequest(void)
}
/* Read the EEPROM byte and send it via USB to the host */
Endpoint_Write_Byte(eeprom_read_byte((uint8_t*)StartAddr));
Endpoint_Write_8(eeprom_read_byte((uint8_t*)StartAddr));
/* Adjust counters */
StartAddr++;
......@@ -436,17 +436,17 @@ void EVENT_USB_Device_ControlRequest(void)
Endpoint_ClearSETUP();
/* Write 8-bit status value */
Endpoint_Write_Byte(DFU_Status);
Endpoint_Write_8(DFU_Status);
/* Write 24-bit poll timeout value */
Endpoint_Write_Byte(0);
Endpoint_Write_Word_LE(0);
Endpoint_Write_8(0);
Endpoint_Write_16_LE(0);
/* Write 8-bit state value */
Endpoint_Write_Byte(DFU_State);
Endpoint_Write_8(DFU_State);
/* Write 8-bit state string ID number */
Endpoint_Write_Byte(0);
Endpoint_Write_8(0);
Endpoint_ClearIN();
......@@ -464,7 +464,7 @@ void EVENT_USB_Device_ControlRequest(void)
Endpoint_ClearSETUP();
/* Write the current device state to the endpoint */
Endpoint_Write_Byte(DFU_State);
Endpoint_Write_8(DFU_State);
Endpoint_ClearIN();
......@@ -503,7 +503,7 @@ static void DiscardFillerBytes(uint8_t NumberOfBytes)
}
else
{
Endpoint_Discard_Byte();
Endpoint_Discard_8();
}
}
}
......
......@@ -113,7 +113,7 @@ void EVENT_USB_Device_ControlRequest(void)
while (!(Endpoint_IsOUTReceived()));
/* Read in the write destination address */
uint16_t PageAddress = Endpoint_Read_Word_LE();
uint16_t PageAddress = Endpoint_Read_16_LE();
/* Check if the command is a program page command, or a start application command */
if (PageAddress == COMMAND_STARTAPPLICATION)
......@@ -137,7 +137,7 @@ void EVENT_USB_Device_ControlRequest(void)
}
/* Write the next data word to the FLASH page */
boot_page_fill(PageAddress + ((uint16_t)PageWord << 1), Endpoint_Read_Word_LE());
boot_page_fill(PageAddress + ((uint16_t)PageWord << 1), Endpoint_Read_16_LE());
}
/* Write the filled FLASH page to memory */
......
......@@ -129,22 +129,22 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
}
/* Write one 16-byte chunk of data to the Dataflash */
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
/* Increment the Dataflash page 16 byte block counter */
CurrDFPageByteDiv16++;
......@@ -244,22 +244,22 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
}
/* Read one 16-byte chunk of data from the Dataflash */
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
/* Increment the Dataflash page 16 byte block counter */
CurrDFPageByteDiv16++;
......
......@@ -334,10 +334,10 @@ static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfa
static bool SCSI_Command_ModeSense_6(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
{
/* Send an empty header response with the Write Protect flag status */
Endpoint_Write_Byte(0x00);
Endpoint_Write_Byte(0x00);
Endpoint_Write_Byte(DISK_READ_ONLY ? 0x80 : 0x00);
Endpoint_Write_Byte(0x00);
Endpoint_Write_8(0x00);
Endpoint_Write_8(0x00);
Endpoint_Write_8(DISK_READ_ONLY ? 0x80 : 0x00);
Endpoint_Write_8(0x00);
Endpoint_ClearIN();
/* Update the bytes transferred counter and succeed the command */
......
......@@ -129,22 +129,22 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
}
/* Write one 16-byte chunk of data to the Dataflash */
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
/* Increment the Dataflash page 16 byte block counter */
CurrDFPageByteDiv16++;
......@@ -244,22 +244,22 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
}
/* Read one 16-byte chunk of data from the Dataflash */
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
/* Increment the Dataflash page 16 byte block counter */
CurrDFPageByteDiv16++;
......
......@@ -334,10 +334,10 @@ static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfa
static bool SCSI_Command_ModeSense_6(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
{
/* Send an empty header response with the Write Protect flag status */
Endpoint_Write_Byte(0x00);
Endpoint_Write_Byte(0x00);
Endpoint_Write_Byte(DISK_READ_ONLY ? 0x80 : 0x00);
Endpoint_Write_Byte(0x00);
Endpoint_Write_8(0x00);
Endpoint_Write_8(0x00);
Endpoint_Write_8(DISK_READ_ONLY ? 0x80 : 0x00);
Endpoint_Write_8(0x00);
Endpoint_ClearIN();
/* Update the bytes transferred counter and succeed the command */
......
......@@ -129,22 +129,22 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
}
/* Write one 16-byte chunk of data to the Dataflash */
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
Dataflash_SendByte(Endpoint_Read_8());
/* Increment the Dataflash page 16 byte block counter */
CurrDFPageByteDiv16++;
......@@ -244,22 +244,22 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
}
/* Read one 16-byte chunk of data from the Dataflash */
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
Endpoint_Write_8(Dataflash_ReceiveByte());
/* Increment the Dataflash page 16 byte block counter */
CurrDFPageByteDiv16++;
......
......@@ -334,10 +334,10 @@ static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfa
static bool SCSI_Command_ModeSense_6(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
{
/* Send an empty header response with the Write Protect flag status */
Endpoint_Write_Byte(0x00);
Endpoint_Write_Byte(0x00);
Endpoint_Write_Byte(DISK_READ_ONLY ? 0x80 : 0x00);
Endpoint_Write_Byte(0x00);
Endpoint_Write_8(0x00);
Endpoint_Write_8(0x00);
Endpoint_Write_8(DISK_READ_ONLY ? 0x80 : 0x00);
Endpoint_Write_8(0x00);
Endpoint_ClearIN();
/* Update the bytes transferred counter and succeed the command */
......
......@@ -311,7 +311,7 @@ static void SideShow_GetApplicationOrder(SideShow_PacketHeader_t* const PacketHe
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_Write_DWord_LE(TotalApplications);
Endpoint_Write_32_LE(TotalApplications);
for (uint8_t App = 0; App < MAX_APPLICATIONS; App++)
{
......@@ -332,7 +332,7 @@ static void SideShow_GetSupportedEndpoints(SideShow_PacketHeader_t* const Packet
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_Write_DWord_LE(1);
Endpoint_Write_32_LE(1);
Endpoint_Write_Stream_LE(&SupportedEndpointGUID, sizeof(GUID_t), NULL);
Endpoint_ClearIN();
}
......
......@@ -169,7 +169,7 @@ void EVENT_USB_Device_ControlRequest(void)
Endpoint_ClearSETUP();
/* Write the request response byte */
Endpoint_Write_Byte(TMCRequestStatus);
Endpoint_Write_8(TMCRequestStatus);
Endpoint_ClearIN();
Endpoint_ClearStatusStage();
......@@ -190,9 +190,9 @@ void EVENT_USB_Device_ControlRequest(void)
Endpoint_ClearSETUP();
/* Write the request response bytes */
Endpoint_Write_Byte(TMCRequestStatus);
Endpoint_Write_Word_LE(0);
Endpoint_Write_DWord_LE(LastTransferLength);
Endpoint_Write_8(TMCRequestStatus);
Endpoint_Write_16_LE(0);
Endpoint_Write_32_LE(LastTransferLength);
Endpoint_ClearIN();
Endpoint_ClearStatusStage();
......@@ -223,8 +223,8 @@ void EVENT_USB_Device_ControlRequest(void)
Endpoint_ClearSETUP();
/* Write the request response bytes */
Endpoint_Write_Byte(TMCRequestStatus);
Endpoint_Write_Byte(CurrentTransferTag);
Endpoint_Write_8(TMCRequestStatus);
Endpoint_Write_8(CurrentTransferTag);
Endpoint_ClearIN();
Endpoint_ClearStatusStage();
......@@ -245,9 +245,9 @@ void EVENT_USB_Device_ControlRequest(void)
Endpoint_ClearSETUP();
/* Write the request response bytes */
Endpoint_Write_Byte(TMCRequestStatus);
Endpoint_Write_Word_LE(0);
Endpoint_Write_DWord_LE(LastTransferLength);
Endpoint_Write_8(TMCRequestStatus);
Endpoint_Write_16_LE(0);
Endpoint_Write_32_LE(LastTransferLength);
Endpoint_ClearIN();
Endpoint_ClearStatusStage();
......@@ -260,7 +260,7 @@ void EVENT_USB_Device_ControlRequest(void)
/* Check that no split transaction is already in progress */
if (RequestInProgress != 0)
{
Endpoint_Write_Byte(TMC_STATUS_SPLIT_IN_PROGRESS);
Endpoint_Write_8(TMC_STATUS_SPLIT_IN_PROGRESS);
}
else
{
......@@ -275,7 +275,7 @@ void EVENT_USB_Device_ControlRequest(void)
Endpoint_ClearSETUP();
/* Write the request response byte */
Endpoint_Write_Byte(TMCRequestStatus);
Endpoint_Write_8(TMCRequestStatus);
Endpoint_ClearIN();
Endpoint_ClearStatusStage();
......@@ -296,8 +296,8 @@ void EVENT_USB_Device_ControlRequest(void)
Endpoint_ClearSETUP();
/* Write the request response bytes */
Endpoint_Write_Byte(TMCRequestStatus);
Endpoint_Write_Byte(0);
Endpoint_Write_8(TMCRequestStatus);
Endpoint_Write_8(0);
Endpoint_ClearIN();
Endpoint_ClearStatusStage();
......
......@@ -180,7 +180,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
#endif
/* Write the sample to the buffer */
Endpoint_Write_Word_LE(AudioSample);
Endpoint_Write_16_LE(AudioSample);
/* Check to see if the bank is now full */
if (!(Endpoint_IsReadWriteAllowed()))
......
......@@ -184,8 +184,8 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
if (Endpoint_IsOUTReceived() && StreamingAudioInterfaceSelected)
{
/* Retrieve the signed 16-bit left and right audio samples, convert to 8-bit */
int8_t LeftSample_8Bit = ((int16_t)Endpoint_Read_Word_LE() >> 8);
int8_t RightSample_8Bit = ((int16_t)Endpoint_Read_Word_LE() >> 8);
int8_t LeftSample_8Bit = ((int16_t)Endpoint_Read_16_LE() >> 8);
int8_t RightSample_8Bit = ((int16_t)Endpoint_Read_16_LE() >> 8);
/* Mix the two channels together to produce a mono, 8-bit sample */
int8_t MixedSample_8Bit = (((int16_t)LeftSample_8Bit + (int16_t)RightSample_8Bit) >> 1);
......
......@@ -167,7 +167,7 @@ void EVENT_USB_Device_ControlRequest(void)
}
/* Read in the LED report from the host */
uint8_t LEDStatus = Endpoint_Read_Byte();
uint8_t LEDStatus = Endpoint_Read_8();
Endpoint_ClearOUT();
Endpoint_ClearStatusStage();
......@@ -183,7 +183,7 @@ void EVENT_USB_Device_ControlRequest(void)
Endpoint_ClearSETUP();
/* Write the current protocol flag to the host */
Endpoint_Write_Byte(UsingReportProtocol);
Endpoint_Write_8(UsingReportProtocol);
Endpoint_ClearIN();
Endpoint_ClearStatusStage();
......@@ -218,7 +218,7 @@ void EVENT_USB_Device_ControlRequest(void)
Endpoint_ClearSETUP();
/* Write the current idle duration to the host, must be divided by 4 before sent to host */
Endpoint_Write_Byte(IdleCount >> 2);
Endpoint_Write_8(IdleCount >> 2);
Endpoint_ClearIN();
Endpoint_ClearStatusStage();
......@@ -344,7 +344,7 @@ void ReceiveNextReport(void)
if (Endpoint_IsReadWriteAllowed())
{
/* Read in the LED report from the host */
uint8_t LEDReport = Endpoint_Read_Byte();
uint8_t LEDReport = Endpoint_Read_8();
/* Process the read LED report from the host */
ProcessLEDReport(LEDReport);
......
......@@ -168,7 +168,7 @@ void EVENT_USB_Device_ControlRequest(void)
}
/* Read in the LED report from the host */
uint8_t LEDStatus = Endpoint_Read_Byte();
uint8_t LEDStatus = Endpoint_Read_8();
Endpoint_ClearOUT();
Endpoint_ClearStatusStage();
......@@ -258,7 +258,7 @@ void Keyboard_HID_Task(void)
if (Endpoint_IsReadWriteAllowed())
{
/* Read in and process the LED report from the host */
Keyboard_ProcessLEDReport(Endpoint_Read_Byte());
Keyboard_ProcessLEDReport(Endpoint_Read_8());
/* Handshake the OUT Endpoint - clear endpoint and ready for next report */
Endpoint_ClearOUT();
......
......@@ -127,22 +127,22 @@ void DataflashManager_WriteBlocks(const uint32_t BlockAddress,
}
/* Write one 16-byte chunk of data to the Dataflash */
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_8());