projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
AppConfigHeaders: Update several additional user projects to use configuration header...
[pub/USBasp.git]
/
Projects
/
AVRISP-MKII
/
Lib
/
XPROG
/
XPROGProtocol.c
diff --git
a/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
b/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
index
54d237a
..
ad8cd53
100644
(file)
--- a/
Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
+++ b/
Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
@@
-7,7
+7,7
@@
*/
/*
*/
/*
- Copyright 201
1
Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 201
2
Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@
-65,7
+65,7
@@
void XPROGProtocol_SetMode(void)
Endpoint_Read_Stream_LE(&SetMode_XPROG_Params, sizeof(SetMode_XPROG_Params), NULL);
Endpoint_ClearOUT();
Endpoint_Read_Stream_LE(&SetMode_XPROG_Params, sizeof(SetMode_XPROG_Params), NULL);
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EP
NUM
);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EP
ADDR
);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
XPROG_SelectedProtocol = SetMode_XPROG_Params.Protocol;
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();
static void XPROGProtocol_EnterXPROGMode(void)
{
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EP
NUM
);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EP
ADDR
);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
bool NVMBusEnabled = false;
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
bool NVMBusEnabled = false;
@@
-134,7
+134,7
@@
static void XPROGProtocol_EnterXPROGMode(void)
static void XPROGProtocol_LeaveXPROGMode(void)
{
Endpoint_ClearOUT();
static void XPROGProtocol_LeaveXPROGMode(void)
{
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EP
NUM
);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EP
ADDR
);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
if (XPROG_SelectedProtocol == XPRG_PROTOCOL_PDI)
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();
Erase_XPROG_Params.Address = SwapEndian_32(Erase_XPROG_Params.Address);
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EP
NUM
);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EP
ADDR
);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
uint8_t EraseCommand;
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
uint8_t EraseCommand;
@@
-260,7
+260,7
@@
static void XPROGProtocol_WriteMemory(void)
}
Endpoint_ClearOUT();
}
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EP
NUM
);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EP
ADDR
);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
if (XPROG_SelectedProtocol == XPRG_PROTOCOL_PDI)
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();
ReadMemory_XPROG_Params.Length = SwapEndian_16(ReadMemory_XPROG_Params.Length);
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EP
NUM
);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EP
ADDR
);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
uint8_t ReadBuffer[256];
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_Read_Stream_LE(&ReadCRC_XPROG_Params, sizeof(ReadCRC_XPROG_Params), NULL);
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EP
NUM
);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EP
ADDR
);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
uint32_t MemoryCRC;
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
uint32_t MemoryCRC;
@@
-455,13
+455,19
@@
static void XPROGProtocol_SetParam(void)
case XPRG_PARAM_NVMCSR_REG:
XPROG_Param_NVMCSRRegAddr = Endpoint_Read_8();
break;
case XPRG_PARAM_NVMCSR_REG:
XPROG_Param_NVMCSRRegAddr = Endpoint_Read_8();
break;
+ case XPRG_PARAM_UNKNOWN_1:
+ /* TODO: Undocumented parameter added in AVRStudio 5.1, purpose unknown. Must ACK and discard or
+ the communication with AVRStudio 5.1 will fail.
+ */
+ Endpoint_Discard_16();
+ break;
default:
ReturnStatus = XPRG_ERR_FAILED;
break;
}
Endpoint_ClearOUT();
default:
ReturnStatus = XPRG_ERR_FAILED;
break;
}
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EP
NUM
);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EP
ADDR
);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
Endpoint_Write_8(CMD_XPROG);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
Endpoint_Write_8(CMD_XPROG);