Reintegrate the FullEPAddresses development branch into trunk.
This commit is contained in:
parent
e8570c4a37
commit
47f6a35013
265 changed files with 2120 additions and 2486 deletions
|
|
@ -93,12 +93,10 @@ void EVENT_USB_Device_ConfigurationChanged(void)
|
|||
bool ConfigSuccess = true;
|
||||
|
||||
/* Setup AVRISP Data Endpoint(s) */
|
||||
ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_OUT_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT,
|
||||
AVRISP_DATA_EPSIZE, ENDPOINT_BANK_SINGLE);
|
||||
ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_OUT_EPADDR, EP_TYPE_BULK, AVRISP_DATA_EPSIZE, 1);
|
||||
|
||||
#if defined(LIBUSB_DRIVER_COMPAT)
|
||||
ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_IN_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN,
|
||||
AVRISP_DATA_EPSIZE, ENDPOINT_BANK_SINGLE);
|
||||
ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_IN_EPADDR, EP_TYPE_BULK, AVRISP_DATA_EPSIZE, 1);
|
||||
#endif
|
||||
|
||||
/* Indicate endpoint configuration success or failure */
|
||||
|
|
@ -114,7 +112,7 @@ void AVRISP_Task(void)
|
|||
|
||||
V2Params_UpdateParamValues();
|
||||
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_OUT_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_OUT_EPADDR);
|
||||
|
||||
/* Check to see if a V2 Protocol command has been received */
|
||||
if (Endpoint_IsOUTReceived())
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||
{
|
||||
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||
|
||||
.EndpointAddress = (ENDPOINT_DIR_IN | AVRISP_DATA_IN_EPNUM),
|
||||
.EndpointAddress = AVRISP_DATA_IN_EPADDR,
|
||||
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
|
||||
.EndpointSize = AVRISP_DATA_EPSIZE,
|
||||
.PollingIntervalMS = 0x0A
|
||||
|
|
@ -116,7 +116,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||
{
|
||||
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||
|
||||
.EndpointAddress = (ENDPOINT_DIR_OUT | AVRISP_DATA_OUT_EPNUM),
|
||||
.EndpointAddress = AVRISP_DATA_OUT_EPADDR,
|
||||
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
|
||||
.EndpointSize = AVRISP_DATA_EPSIZE,
|
||||
.PollingIntervalMS = 0x0A
|
||||
|
|
|
|||
|
|
@ -42,18 +42,15 @@
|
|||
#include <LUFA/Drivers/USB/USB.h>
|
||||
|
||||
/* Macros: */
|
||||
#if !defined(LIBUSB_DRIVER_COMPAT)
|
||||
/** Endpoint number of the AVRISP data OUT endpoint. */
|
||||
#define AVRISP_DATA_OUT_EPNUM 2
|
||||
#if !defined(LIBUSB_DRIVER_COMPAT) || defined(__DOXYGEN__)
|
||||
/** Endpoint address of the AVRISP data OUT endpoint. */
|
||||
#define AVRISP_DATA_OUT_EPADDR (ENDPOINT_DIR_OUT | 2)
|
||||
|
||||
/** Endpoint number of the AVRISP data IN endpoint. */
|
||||
#define AVRISP_DATA_IN_EPNUM 2
|
||||
/** Endpoint address of the AVRISP data IN endpoint. */
|
||||
#define AVRISP_DATA_IN_EPADDR (ENDPOINT_DIR_IN | 2)
|
||||
#else
|
||||
/** Endpoint number of the AVRISP data OUT endpoint. */
|
||||
#define AVRISP_DATA_OUT_EPNUM 2
|
||||
|
||||
/** Endpoint number of the AVRISP data IN endpoint. */
|
||||
#define AVRISP_DATA_IN_EPNUM 3
|
||||
#define AVRISP_DATA_OUT_EPADDR (ENDPOINT_DIR_OUT | 2)
|
||||
#define AVRISP_DATA_IN_EPADDR (ENDPOINT_DIR_IN | 3)
|
||||
#endif
|
||||
|
||||
/** Size in bytes of the AVRISP data endpoint. */
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ void ISPProtocol_EnterISPMode(void)
|
|||
Endpoint_Read_Stream_LE(&Enter_ISP_Params, sizeof(Enter_ISP_Params), NULL);
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
uint8_t ResponseStatus = STATUS_CMD_FAILED;
|
||||
|
|
@ -115,7 +115,7 @@ void ISPProtocol_LeaveISPMode(void)
|
|||
Endpoint_Read_Stream_LE(&Leave_ISP_Params, sizeof(Leave_ISP_Params), NULL);
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
/* Perform pre-exit delay, release the target /RESET, disable the SPI bus and perform the post-exit delay */
|
||||
|
|
@ -154,7 +154,7 @@ void ISPProtocol_ProgramMemory(uint8_t V2Command)
|
|||
if (Write_Memory_Params.BytesToWrite > sizeof(Write_Memory_Params.ProgData))
|
||||
{
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
Endpoint_Write_8(V2Command);
|
||||
|
|
@ -175,7 +175,7 @@ void ISPProtocol_ProgramMemory(uint8_t V2Command)
|
|||
}
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
uint8_t ProgrammingStatus = STATUS_CMD_OK;
|
||||
|
|
@ -295,7 +295,7 @@ void ISPProtocol_ReadMemory(uint8_t V2Command)
|
|||
Read_Memory_Params.BytesToRead = SwapEndian_16(Read_Memory_Params.BytesToRead);
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
Endpoint_Write_8(V2Command);
|
||||
|
|
@ -368,7 +368,7 @@ void ISPProtocol_ChipErase(void)
|
|||
Endpoint_Read_Stream_LE(&Erase_Chip_Params, sizeof(Erase_Chip_Params), NULL);
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
uint8_t ResponseStatus = STATUS_CMD_OK;
|
||||
|
|
@ -404,7 +404,7 @@ void ISPProtocol_ReadFuseLockSigOSCCAL(uint8_t V2Command)
|
|||
Endpoint_Read_Stream_LE(&Read_FuseLockSigOSCCAL_Params, sizeof(Read_FuseLockSigOSCCAL_Params), NULL);
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
uint8_t ResponseBytes[4];
|
||||
|
|
@ -435,7 +435,7 @@ void ISPProtocol_WriteFuseLock(uint8_t V2Command)
|
|||
Endpoint_Read_Stream_LE(&Write_FuseLockSig_Params, sizeof(Write_FuseLockSig_Params), NULL);
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
/* Send the Fuse or Lock byte program commands as given by the host to the device */
|
||||
|
|
@ -463,7 +463,7 @@ void ISPProtocol_SPIMulti(void)
|
|||
Endpoint_Read_Stream_LE(&SPI_Multi_Params.TxData, SPI_Multi_Params.TxBytes, NULL);
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
Endpoint_Write_8(CMD_SPI_MULTI);
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ void V2Protocol_ProcessCommand(void)
|
|||
TCCR0B = 0;
|
||||
|
||||
Endpoint_WaitUntilReady();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_OUT_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_OUT_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_OUT);
|
||||
}
|
||||
|
||||
|
|
@ -169,7 +169,7 @@ static void V2Protocol_UnknownCommand(const uint8_t V2Command)
|
|||
}
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
Endpoint_Write_8(V2Command);
|
||||
|
|
@ -181,7 +181,7 @@ static void V2Protocol_UnknownCommand(const uint8_t V2Command)
|
|||
static void V2Protocol_SignOn(void)
|
||||
{
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
Endpoint_Write_8(CMD_SIGN_ON);
|
||||
|
|
@ -197,7 +197,7 @@ static void V2Protocol_SignOn(void)
|
|||
static void V2Protocol_ResetProtection(void)
|
||||
{
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
Endpoint_Write_8(CMD_RESET_PROTECTION);
|
||||
|
|
@ -220,7 +220,7 @@ static void V2Protocol_GetSetParam(const uint8_t V2Command)
|
|||
ParamValue = Endpoint_Read_8();
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
Endpoint_Write_8(V2Command);
|
||||
|
|
@ -254,7 +254,7 @@ static void V2Protocol_LoadAddress(void)
|
|||
Endpoint_Read_Stream_BE(&CurrentAddress, sizeof(CurrentAddress), NULL);
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
if (CurrentAddress & (1UL << 31))
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ void XPROGProtocol_SetMode(void)
|
|||
Endpoint_Read_Stream_LE(&SetMode_XPROG_Params, sizeof(SetMode_XPROG_Params), NULL);
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
XPROG_SelectedProtocol = SetMode_XPROG_Params.Protocol;
|
||||
|
|
@ -112,7 +112,7 @@ void XPROGProtocol_Command(void)
|
|||
static void XPROGProtocol_EnterXPROGMode(void)
|
||||
{
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
bool NVMBusEnabled = false;
|
||||
|
|
@ -134,7 +134,7 @@ static void XPROGProtocol_EnterXPROGMode(void)
|
|||
static void XPROGProtocol_LeaveXPROGMode(void)
|
||||
{
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
if (XPROG_SelectedProtocol == XPRG_PROTOCOL_PDI)
|
||||
|
|
@ -169,7 +169,7 @@ static void XPROGProtocol_Erase(void)
|
|||
Erase_XPROG_Params.Address = SwapEndian_32(Erase_XPROG_Params.Address);
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
uint8_t EraseCommand;
|
||||
|
|
@ -260,7 +260,7 @@ static void XPROGProtocol_WriteMemory(void)
|
|||
}
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
if (XPROG_SelectedProtocol == XPRG_PROTOCOL_PDI)
|
||||
|
|
@ -342,7 +342,7 @@ static void XPROGProtocol_ReadMemory(void)
|
|||
ReadMemory_XPROG_Params.Length = SwapEndian_16(ReadMemory_XPROG_Params.Length);
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
uint8_t ReadBuffer[256];
|
||||
|
|
@ -385,7 +385,7 @@ static void XPROGProtocol_ReadCRC(void)
|
|||
Endpoint_Read_Stream_LE(&ReadCRC_XPROG_Params, sizeof(ReadCRC_XPROG_Params), NULL);
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
uint32_t MemoryCRC;
|
||||
|
|
@ -467,7 +467,7 @@ static void XPROGProtocol_SetParam(void)
|
|||
}
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
|
||||
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
Endpoint_Write_8(CMD_XPROG);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue