Add dummy undocumented TPI XPROG parameters to the AVRISP project so that TPI program...
[pub/USBasp.git] / Projects / AVRISP-MKII / Lib / XPROG / XPROGProtocol.c
index bccb96c..f3f888e 100644 (file)
@@ -9,13 +9,13 @@
 /*\r
   Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
 \r
 /*\r
   Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
 \r
-  Permission to use, copy, modify, and distribute this software\r
-  and its documentation for any purpose and without fee is hereby\r
-  granted, provided that the above copyright notice appear in all\r
-  copies and that both that the copyright notice and this\r
-  permission notice and warranty disclaimer appear in supporting\r
-  documentation, and that the name of the author not be used in\r
-  advertising or publicity pertaining to distribution of the\r
+  Permission to use, copy, modify, distribute, and sell this \r
+  software and its documentation for any purpose is hereby granted\r
+  without fee, provided that the above copyright notice appear in \r
+  all copies and that both that the copyright notice and this\r
+  permission notice and warranty disclaimer appear in supporting \r
+  documentation, and that the name of the author not be used in \r
+  advertising or publicity pertaining to distribution of the \r
   software without specific, written prior permission.\r
 \r
   The author disclaim all warranties with regard to this\r
   software without specific, written prior permission.\r
 \r
   The author disclaim all warranties with regard to this\r
@@ -74,7 +74,7 @@ void XPROGProtocol_SetMode(void)
 void XPROGProtocol_Command(void)\r
 {\r
        uint8_t XPROGCommand = Endpoint_Read_Byte();\r
 void XPROGProtocol_Command(void)\r
 {\r
        uint8_t XPROGCommand = Endpoint_Read_Byte();\r
-\r
+       \r
        switch (XPROGCommand)\r
        {\r
                case XPRG_CMD_ENTER_PROGMODE:\r
        switch (XPROGCommand)\r
        {\r
                case XPRG_CMD_ENTER_PROGMODE:\r
@@ -420,13 +420,22 @@ static void XPROGProtocol_SetParam(void)
        uint8_t XPROGParam = Endpoint_Read_Byte();\r
        \r
        /* Determine which parameter is being set, store the new parameter value */\r
        uint8_t XPROGParam = Endpoint_Read_Byte();\r
        \r
        /* Determine which parameter is being set, store the new parameter value */\r
-       if (XPROGParam == XPRG_PARAM_NVMBASE)\r
-         XPROG_Param_NVMBase = Endpoint_Read_DWord_BE();\r
-       else if (XPROGParam == XPRG_PARAM_EEPPAGESIZE)\r
-         XPROG_Param_EEPageSize = Endpoint_Read_Word_BE();\r
-       else\r
-         ReturnStatus = XPRG_ERR_FAILED;\r
-       \r
+       switch (XPROGParam)\r
+       {\r
+               case XPRG_PARAM_NVMBASE:\r
+                       XPROG_Param_NVMBase = Endpoint_Read_DWord_BE();\r
+                       break;\r
+               case XPRG_PARAM_EEPPAGESIZE:\r
+                       XPROG_Param_EEPageSize = Endpoint_Read_Word_BE();\r
+                       break;\r
+               case XPRG_PARAM_UNDOC_1:\r
+               case XPRG_PARAM_UNDOC_2:\r
+                       break; // Undocumented TPI parameter, just accept and discard\r
+               default:\r
+                       ReturnStatus = XPRG_ERR_FAILED;\r
+                       break;\r
+       }\r
+\r
        Endpoint_ClearOUT();\r
        Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);\r
                  \r
        Endpoint_ClearOUT();\r
        Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);\r
                  \r