aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-12-28 02:58:23 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-12-28 02:58:23 +0000
commit3222f21b849ca283cc6c1f07c347285b8cbce075 (patch)
treeb30164aa3796fa0b94484f87d8f79924f0e6249e /Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
parent39ab7507dd4be15b9208744abe85e265fac4c71f (diff)
downloadlufa-3222f21b849ca283cc6c1f07c347285b8cbce075.tar.gz
lufa-3222f21b849ca283cc6c1f07c347285b8cbce075.tar.bz2
lufa-3222f21b849ca283cc6c1f07c347285b8cbce075.zip
Add dummy undocumented TPI XPROG parameters to the AVRISP project so that TPI programming mode can be entered.
Diffstat (limited to 'Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c')
-rw-r--r--Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c b/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
index b8c435efa..f3f888e1c 100644
--- a/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
+++ b/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
@@ -74,7 +74,7 @@ void XPROGProtocol_SetMode(void)
void XPROGProtocol_Command(void)
{
uint8_t XPROGCommand = Endpoint_Read_Byte();
-
+
switch (XPROGCommand)
{
case XPRG_CMD_ENTER_PROGMODE:
@@ -420,13 +420,22 @@ static void XPROGProtocol_SetParam(void)
uint8_t XPROGParam = Endpoint_Read_Byte();
/* Determine which parameter is being set, store the new parameter value */
- if (XPROGParam == XPRG_PARAM_NVMBASE)
- XPROG_Param_NVMBase = Endpoint_Read_DWord_BE();
- else if (XPROGParam == XPRG_PARAM_EEPPAGESIZE)
- XPROG_Param_EEPageSize = Endpoint_Read_Word_BE();
- else
- ReturnStatus = XPRG_ERR_FAILED;
-
+ switch (XPROGParam)
+ {
+ case XPRG_PARAM_NVMBASE:
+ XPROG_Param_NVMBase = Endpoint_Read_DWord_BE();
+ break;
+ 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_SetEndpointDirection(ENDPOINT_DIR_IN);