switch (V2Command)\r
{\r
case CMD_SIGN_ON:\r
- V2Protocol_Command_SignOn();\r
+ V2Protocol_SignOn();\r
break;\r
case CMD_SET_PARAMETER:\r
case CMD_GET_PARAMETER:\r
- V2Protocol_Command_GetSetParam(V2Command);\r
+ V2Protocol_GetSetParam(V2Command);\r
break;\r
case CMD_LOAD_ADDRESS:\r
- V2Protocol_Command_LoadAddress();\r
+ V2Protocol_LoadAddress();\r
break;\r
case CMD_RESET_PROTECTION:\r
- V2Protocol_Command_ResetProtection();\r
+ V2Protocol_ResetProtection();\r
break;\r
case CMD_ENTER_PROGMODE_ISP:\r
- V2Protocol_Command_EnterISPMode();\r
+ V2Protocol_ISP_EnterISPMode();\r
break;\r
case CMD_LEAVE_PROGMODE_ISP:\r
- V2Protocol_Command_LeaveISPMode();\r
+ V2Protocol_ISP_LeaveISPMode();\r
break;\r
case CMD_PROGRAM_FLASH_ISP:\r
case CMD_PROGRAM_EEPROM_ISP:\r
- V2Protocol_Command_ProgramMemory(V2Command); \r
+ V2Protocol_ISP_ProgramMemory(V2Command); \r
break;\r
case CMD_READ_FLASH_ISP:\r
case CMD_READ_EEPROM_ISP:\r
- V2Protocol_Command_ReadMemory(V2Command);\r
+ V2Protocol_ISP_ReadMemory(V2Command);\r
break;\r
case CMD_CHIP_ERASE_ISP:\r
- V2Protocol_Command_ChipErase();\r
+ V2Protocol_ISP_ChipErase();\r
break;\r
case CMD_READ_FUSE_ISP:\r
case CMD_READ_LOCK_ISP:\r
case CMD_READ_SIGNATURE_ISP:\r
case CMD_READ_OSCCAL_ISP:\r
- V2Protocol_Command_ReadFuseLockSigOSCCAL(V2Command);\r
+ V2Protocol_ISP_ReadFuseLockSigOSCCAL(V2Command);\r
break;\r
case CMD_PROGRAM_FUSE_ISP:\r
case CMD_PROGRAM_LOCK_ISP:\r
- V2Protocol_Command_WriteFuseLock(V2Command);\r
+ V2Protocol_ISP_WriteFuseLock(V2Command);\r
break;\r
case CMD_SPI_MULTI:\r
- V2Protocol_Command_SPIMulti();\r
+ V2Protocol_ISP_SPIMulti();\r
break;\r
default:\r
- V2Protocol_Command_Unknown(V2Command);\r
+ V2Protocol_UnknownCommand(V2Command);\r
break;\r
}\r
\r
*\r
* \param[in] V2Command Issued V2 Protocol command byte from the host\r
*/\r
-static void V2Protocol_Command_Unknown(uint8_t V2Command)\r
+static void V2Protocol_UnknownCommand(uint8_t V2Command)\r
{\r
/* Discard all incoming data */\r
while (Endpoint_BytesInEndpoint() == AVRISP_DATA_EPSIZE)\r
}\r
\r
/** Handler for the CMD_SIGN_ON command, returning the programmer ID string to the host. */\r
-static void V2Protocol_Command_SignOn(void)\r
+static void V2Protocol_SignOn(void)\r
{\r
Endpoint_ClearOUT();\r
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);\r
Endpoint_ClearIN();\r
}\r
\r
+/** Handler for the CMD_RESET_PROTECTION command, currently implemented as a dummy ACK function\r
+ * as no ISP short-circuit protection is currently implemented.\r
+ */\r
+static void V2Protocol_ResetProtection(void)\r
+{\r
+ Endpoint_ClearOUT();\r
+ Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);\r
+ \r
+ Endpoint_Write_Byte(CMD_RESET_PROTECTION);\r
+ Endpoint_Write_Byte(STATUS_CMD_OK);\r
+ Endpoint_ClearIN(); \r
+}\r
+\r
+\r
/** Handler for the CMD_SET_PARAMETER and CMD_GET_PARAMETER commands from the host, setting or\r
* getting a device parameter's value from the parameter table.\r
*\r
* \param[in] V2Command Issued V2 Protocol command byte from the host\r
*/\r
-static void V2Protocol_Command_GetSetParam(uint8_t V2Command)\r
+static void V2Protocol_GetSetParam(uint8_t V2Command)\r
{\r
uint8_t ParamID = Endpoint_Read_Byte();\r
uint8_t ParamValue;\r
* global storage variable for later use, and issuing LOAD EXTENDED ADDRESS commands\r
* to the attached device as required.\r
*/\r
-static void V2Protocol_Command_LoadAddress(void)\r
+static void V2Protocol_LoadAddress(void)\r
{\r
Endpoint_Read_Stream_BE(&CurrentAddress, sizeof(CurrentAddress));\r
\r
Endpoint_ClearIN();\r
}\r
\r
-/** Handler for the CMD_RESET_PROTECTION command, currently implemented as a dummy ACK function\r
- * as no ISP short-circuit protection is currently implemented.\r
- */\r
-static void V2Protocol_Command_ResetProtection(void)\r
-{\r
- Endpoint_ClearOUT();\r
- Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);\r
- \r
- Endpoint_Write_Byte(CMD_RESET_PROTECTION);\r
- Endpoint_Write_Byte(STATUS_CMD_OK);\r
- Endpoint_ClearIN(); \r
-}\r
-\r
/** Handler for the CMD_ENTER_PROGMODE_ISP command, which attempts to enter programming mode on\r
* the attached device, returning success or failure back to the host.\r
*/\r
-static void V2Protocol_Command_EnterISPMode(void)\r
+static void V2Protocol_ISP_EnterISPMode(void)\r
{\r
struct\r
{\r
}\r
\r
/** Handler for the CMD_LEAVE_ISP command, which releases the target from programming mode. */\r
-static void V2Protocol_Command_LeaveISPMode(void)\r
+static void V2Protocol_ISP_LeaveISPMode(void)\r
{\r
struct\r
{\r
*\r
* \param[in] V2Command Issued V2 Protocol command byte from the host\r
*/\r
-static void V2Protocol_Command_ProgramMemory(uint8_t V2Command)\r
+static void V2Protocol_ISP_ProgramMemory(uint8_t V2Command)\r
{\r
struct\r
{\r
*\r
* \param[in] V2Command Issued V2 Protocol command byte from the host\r
*/\r
-static void V2Protocol_Command_ReadMemory(uint8_t V2Command)\r
+static void V2Protocol_ISP_ReadMemory(uint8_t V2Command)\r
{\r
struct\r
{\r
}\r
\r
/** Handler for the CMD_CHI_ERASE_ISP command, clearing the target's FLASH memory. */\r
-static void V2Protocol_Command_ChipErase(void)\r
+static void V2Protocol_ISP_ChipErase(void)\r
{\r
struct\r
{\r
*\r
* \param[in] V2Command Issued V2 Protocol command byte from the host\r
*/\r
-static void V2Protocol_Command_ReadFuseLockSigOSCCAL(uint8_t V2Command)\r
+static void V2Protocol_ISP_ReadFuseLockSigOSCCAL(uint8_t V2Command)\r
{\r
struct\r
{\r
*\r
* \param[in] V2Command Issued V2 Protocol command byte from the host\r
*/\r
-static void V2Protocol_Command_WriteFuseLock(uint8_t V2Command)\r
+static void V2Protocol_ISP_WriteFuseLock(uint8_t V2Command)\r
{\r
struct\r
{\r
}\r
\r
/** Handler for the CMD_SPI_MULTI command, writing and reading arbitrary SPI data to and from the attached device. */\r
-static void V2Protocol_Command_SPIMulti(void)\r
+static void V2Protocol_ISP_SPIMulti(void)\r
{\r
struct\r
{\r