Commit 3222f21b authored by Dean Camera's avatar Dean Camera
Browse files

Add dummy undocumented TPI XPROG parameters to the AVRISP project so that TPI...

Add dummy undocumented TPI XPROG parameters to the AVRISP project so that TPI programming mode can be entered.
parent 39ab7507
...@@ -74,7 +74,7 @@ void XPROGProtocol_SetMode(void) ...@@ -74,7 +74,7 @@ void XPROGProtocol_SetMode(void)
void XPROGProtocol_Command(void) void XPROGProtocol_Command(void)
{ {
uint8_t XPROGCommand = Endpoint_Read_Byte(); uint8_t XPROGCommand = Endpoint_Read_Byte();
switch (XPROGCommand) switch (XPROGCommand)
{ {
case XPRG_CMD_ENTER_PROGMODE: case XPRG_CMD_ENTER_PROGMODE:
...@@ -420,13 +420,22 @@ static void XPROGProtocol_SetParam(void) ...@@ -420,13 +420,22 @@ static void XPROGProtocol_SetParam(void)
uint8_t XPROGParam = Endpoint_Read_Byte(); uint8_t XPROGParam = Endpoint_Read_Byte();
/* Determine which parameter is being set, store the new parameter value */ /* Determine which parameter is being set, store the new parameter value */
if (XPROGParam == XPRG_PARAM_NVMBASE) switch (XPROGParam)
XPROG_Param_NVMBase = Endpoint_Read_DWord_BE(); {
else if (XPROGParam == XPRG_PARAM_EEPPAGESIZE) case XPRG_PARAM_NVMBASE:
XPROG_Param_EEPageSize = Endpoint_Read_Word_BE(); XPROG_Param_NVMBase = Endpoint_Read_DWord_BE();
else break;
ReturnStatus = XPRG_ERR_FAILED; case XPRG_PARAM_EEPPAGESIZE:
XPROG_Param_EEPageSize = Endpoint_Read_Word_BE();
break;
case XPRG_PARAM_UNDOC_1:
case XPRG_PARAM_UNDOC_2:
break; // Undocumented TPI parameter, just accept and discard
default:
ReturnStatus = XPRG_ERR_FAILED;
break;
}
Endpoint_ClearOUT(); Endpoint_ClearOUT();
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN); Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
......
...@@ -97,6 +97,8 @@ ...@@ -97,6 +97,8 @@
#define XPRG_PARAM_NVMBASE 0x01 #define XPRG_PARAM_NVMBASE 0x01
#define XPRG_PARAM_EEPPAGESIZE 0x02 #define XPRG_PARAM_EEPPAGESIZE 0x02
#define XPRG_PARAM_UNDOC_1 0x03
#define XPRG_PARAM_UNDOC_2 0x04
#define XPRG_PROTOCOL_PDI 0x00 #define XPRG_PROTOCOL_PDI 0x00
#define XPRG_PROTOCOL_JTAG 0x01 #define XPRG_PROTOCOL_JTAG 0x01
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment