X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/1f8dfd0205d431351425f468627984280b21cd5a..05fcf7e2a79bebb978d4aeaef26b12f70c6826f8:/Projects/AVRISP/Lib/V2Protocol.c?ds=inline diff --git a/Projects/AVRISP/Lib/V2Protocol.c b/Projects/AVRISP/Lib/V2Protocol.c index d2e0b1686..eae2e830f 100644 --- a/Projects/AVRISP/Lib/V2Protocol.c +++ b/Projects/AVRISP/Lib/V2Protocol.c @@ -50,7 +50,9 @@ bool MustSetAddress; void V2Protocol_ProcessCommand(void) { uint8_t V2Command = Endpoint_Read_Byte(); - + + Serial_TxByte(V2Command); + switch (V2Command) { case CMD_SIGN_ON: @@ -66,6 +68,7 @@ void V2Protocol_ProcessCommand(void) case CMD_RESET_PROTECTION: V2Protocol_ResetProtection(); break; +#if defined(ENABLE_ISP_PROTOCOL) case CMD_ENTER_PROGMODE_ISP: ISPProtocol_EnterISPMode(); break; @@ -83,14 +86,6 @@ void V2Protocol_ProcessCommand(void) case CMD_CHIP_ERASE_ISP: ISPProtocol_ChipErase(); break; -#if defined(ENABLE_XPROG_PROTOCOL) - case CMD_XPROG_SETMODE: - PDIProtocol_XPROG_SetMode(); - break; - case CMD_XPROG: - PDIProtocol_XPROG_Command(); - break; -#endif case CMD_READ_FUSE_ISP: case CMD_READ_LOCK_ISP: case CMD_READ_SIGNATURE_ISP: @@ -104,6 +99,18 @@ void V2Protocol_ProcessCommand(void) case CMD_SPI_MULTI: ISPProtocol_SPIMulti(); break; +#endif +#if defined(ENABLE_PDI_PROTOCOL) + case CMD_XPROG_SETMODE: + PDIProtocol_XPROG_SetMode(); + break; + case CMD_XPROG: + PDIProtocol_XPROG_Command(); + break; +#endif +#if defined(ENABLE_TPI_PROTOCOL) + // TODO +#endif default: V2Protocol_UnknownCommand(V2Command); break; @@ -118,7 +125,7 @@ void V2Protocol_ProcessCommand(void) * * \param[in] V2Command Issued V2 Protocol command byte from the host */ -static void V2Protocol_UnknownCommand(uint8_t V2Command) +static void V2Protocol_UnknownCommand(const uint8_t V2Command) { /* Discard all incoming data */ while (Endpoint_BytesInEndpoint() == AVRISP_DATA_EPSIZE) @@ -167,7 +174,7 @@ static void V2Protocol_ResetProtection(void) * * \param[in] V2Command Issued V2 Protocol command byte from the host */ -static void V2Protocol_GetSetParam(uint8_t V2Command) +static void V2Protocol_GetSetParam(const uint8_t V2Command) { uint8_t ParamID = Endpoint_Read_Byte(); uint8_t ParamValue;