aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-03-31 09:20:24 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-03-31 09:20:24 +0000
commitc9148f9b473187163f9b1384b993315e39a14711 (patch)
tree2ba2e20b8efb6662876a960e899c26fe516a5382 /Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
parentce46257ff297d19958b6303f30f69dd053fd9fa1 (diff)
downloadlufa-c9148f9b473187163f9b1384b993315e39a14711.tar.gz
lufa-c9148f9b473187163f9b1384b993315e39a14711.tar.bz2
lufa-c9148f9b473187163f9b1384b993315e39a14711.zip
Added WIN_LIBUSB_COMPAT compile time option to the AVRISP programmer project to make the code compatible with Windows builds of avrdude at the expense of AVRStudio compatibility.
Diffstat (limited to 'Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c')
-rw-r--r--Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c b/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
index 07dce5011..ef86e30f2 100644
--- a/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
+++ b/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
@@ -65,6 +65,7 @@ void XPROGProtocol_SetMode(void)
Endpoint_Read_Stream_LE(&SetMode_XPROG_Params, sizeof(SetMode_XPROG_Params), NO_STREAM_CALLBACK);
Endpoint_ClearOUT();
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
XPROG_SelectedProtocol = SetMode_XPROG_Params.Protocol;
@@ -111,6 +112,7 @@ void XPROGProtocol_Command(void)
static void XPROGProtocol_EnterXPROGMode(void)
{
Endpoint_ClearOUT();
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
bool NVMBusEnabled;
@@ -166,6 +168,7 @@ static void XPROGProtocol_EnterXPROGMode(void)
static void XPROGProtocol_LeaveXPROGMode(void)
{
Endpoint_ClearOUT();
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
if (XPROG_SelectedProtocol == XPRG_PROTOCOL_PDI)
@@ -210,6 +213,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_SetEndpointDirection(ENDPOINT_DIR_IN);
uint8_t EraseCommand;
@@ -291,6 +295,7 @@ static void XPROGProtocol_WriteMemory(void)
Endpoint_Read_Stream_LE(&WriteMemory_XPROG_Params.ProgData, WriteMemory_XPROG_Params.Length, NO_STREAM_CALLBACK);
Endpoint_ClearOUT();
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
if (XPROG_SelectedProtocol == XPRG_PROTOCOL_PDI)
@@ -374,6 +379,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_SetEndpointDirection(ENDPOINT_DIR_IN);
uint8_t ReadBuffer[256];
@@ -416,6 +422,7 @@ static void XPROGProtocol_ReadCRC(void)
Endpoint_Read_Stream_LE(&ReadCRC_XPROG_Params, sizeof(ReadCRC_XPROG_Params), NO_STREAM_CALLBACK);
Endpoint_ClearOUT();
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
uint32_t MemoryCRC;
@@ -491,6 +498,7 @@ static void XPROGProtocol_SetParam(void)
}
Endpoint_ClearOUT();
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
Endpoint_Write_Byte(CMD_XPROG);