diff --git a/LUFA.pnproj b/LUFA.pnproj index 8cddbe4557..126fba08f6 100644 --- a/LUFA.pnproj +++ b/LUFA.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/LUFA/ManPages/FutureChanges.txt b/LUFA/ManPages/FutureChanges.txt index 07b2f83949..3267afc73d 100644 --- a/LUFA/ManPages/FutureChanges.txt +++ b/LUFA/ManPages/FutureChanges.txt @@ -17,7 +17,6 @@ * -# Add ability to get number of bytes not written with pipe/endpoint write routines after an error * -# Add standardized descriptor names to class driver structures * -# Correct mishandling of error cases in Mass Storage demos - * -# Add TPI programming support to the AVRISP project * - Documentation/Support * -# Remake AVRStudio project files * -# Add detailed overviews of how each demo works diff --git a/Projects/AVRISP/AVRISP.c b/Projects/AVRISP/AVRISP.c index c0572fca2f..48a90e3e41 100644 --- a/Projects/AVRISP/AVRISP.c +++ b/Projects/AVRISP/AVRISP.c @@ -70,6 +70,7 @@ void SetupHardware(void) /* Hardware Initialization */ LEDs_Init(); USB_Init(); + Serial_Init(9600, true); #if defined(ADC) /* Initialize the ADC converter for VTARGET level detection on supported AVR models */ diff --git a/Projects/AVRISP/AVRISP.h b/Projects/AVRISP/AVRISP.h index a0f4d5e792..cdd551636d 100644 --- a/Projects/AVRISP/AVRISP.h +++ b/Projects/AVRISP/AVRISP.h @@ -45,6 +45,7 @@ #include "Descriptors.h" #include + #include #include #include diff --git a/Projects/AVRISP/AVRISP.txt b/Projects/AVRISP/AVRISP.txt index 20e0cce0ed..10361ac7be 100644 --- a/Projects/AVRISP/AVRISP.txt +++ b/Projects/AVRISP/AVRISP.txt @@ -162,7 +162,7 @@ * * Programmer Pin: * Target Device Pin: - * PDI 6 Pin Layout: + * TPI 6 Pin Layout: * * * MISO diff --git a/Projects/AVRISP/Lib/V2Protocol.c b/Projects/AVRISP/Lib/V2Protocol.c index 3bfcc11afa..eae2e830fa 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: diff --git a/Projects/AVRISP/Lib/V2Protocol.h b/Projects/AVRISP/Lib/V2Protocol.h index c7c1a7350e..02579a341a 100644 --- a/Projects/AVRISP/Lib/V2Protocol.h +++ b/Projects/AVRISP/Lib/V2Protocol.h @@ -39,6 +39,7 @@ /* Includes: */ #include #include + #include #include "../Descriptors.h" #include "V2ProtocolConstants.h" diff --git a/Projects/AVRISP/Lib/PDI/PDIProtocol.c b/Projects/AVRISP/Lib/XPROG/PDIProtocol.c similarity index 96% rename from Projects/AVRISP/Lib/PDI/PDIProtocol.c rename to Projects/AVRISP/Lib/XPROG/PDIProtocol.c index 16ac209df2..ed51460633 100644 --- a/Projects/AVRISP/Lib/PDI/PDIProtocol.c +++ b/Projects/AVRISP/Lib/XPROG/PDIProtocol.c @@ -58,6 +58,8 @@ void PDIProtocol_XPROG_SetMode(void) Endpoint_ClearOUT(); Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN); + Serial_TxByte(SetMode_XPROG_Params.Protocol); + Endpoint_Write_Byte(CMD_XPROG_SETMODE); Endpoint_Write_Byte((SetMode_XPROG_Params.Protocol == XPRG_PROTOCOL_PDI) ? STATUS_CMD_OK : STATUS_CMD_FAILED); Endpoint_ClearIN(); diff --git a/Projects/AVRISP/Lib/PDI/PDIProtocol.h b/Projects/AVRISP/Lib/XPROG/PDIProtocol.h similarity index 95% rename from Projects/AVRISP/Lib/PDI/PDIProtocol.h rename to Projects/AVRISP/Lib/XPROG/PDIProtocol.h index c3cafb4ecd..9a10abbce6 100644 --- a/Projects/AVRISP/Lib/PDI/PDIProtocol.h +++ b/Projects/AVRISP/Lib/XPROG/PDIProtocol.h @@ -100,6 +100,7 @@ #define XPRG_PROTOCOL_PDI 0x00 #define XPRG_PROTOCOL_JTAG 0x01 + #define XPRG_PROTOCOL_TPI 0x02 #define XPRG_PAGEMODE_WRITE (1 << 1) #define XPRG_PAGEMODE_ERASE (1 << 0) diff --git a/Projects/AVRISP/Lib/PDI/PDITarget.c b/Projects/AVRISP/Lib/XPROG/PDITarget.c similarity index 100% rename from Projects/AVRISP/Lib/PDI/PDITarget.c rename to Projects/AVRISP/Lib/XPROG/PDITarget.c diff --git a/Projects/AVRISP/Lib/PDI/PDITarget.h b/Projects/AVRISP/Lib/XPROG/PDITarget.h similarity index 100% rename from Projects/AVRISP/Lib/PDI/PDITarget.h rename to Projects/AVRISP/Lib/XPROG/PDITarget.h diff --git a/Projects/AVRISP/Lib/TPI/TINYNVM.c b/Projects/AVRISP/Lib/XPROG/TINYNVM.c similarity index 100% rename from Projects/AVRISP/Lib/TPI/TINYNVM.c rename to Projects/AVRISP/Lib/XPROG/TINYNVM.c diff --git a/Projects/AVRISP/Lib/TPI/TINYNVM.h b/Projects/AVRISP/Lib/XPROG/TINYNVM.h similarity index 100% rename from Projects/AVRISP/Lib/TPI/TINYNVM.h rename to Projects/AVRISP/Lib/XPROG/TINYNVM.h diff --git a/Projects/AVRISP/Lib/TPI/TPIProtocol.c b/Projects/AVRISP/Lib/XPROG/TPIProtocol.c similarity index 100% rename from Projects/AVRISP/Lib/TPI/TPIProtocol.c rename to Projects/AVRISP/Lib/XPROG/TPIProtocol.c diff --git a/Projects/AVRISP/Lib/TPI/TPIProtocol.h b/Projects/AVRISP/Lib/XPROG/TPIProtocol.h similarity index 100% rename from Projects/AVRISP/Lib/TPI/TPIProtocol.h rename to Projects/AVRISP/Lib/XPROG/TPIProtocol.h diff --git a/Projects/AVRISP/Lib/TPI/TPITarget.c b/Projects/AVRISP/Lib/XPROG/TPITarget.c similarity index 95% rename from Projects/AVRISP/Lib/TPI/TPITarget.c rename to Projects/AVRISP/Lib/XPROG/TPITarget.c index 464d403057..f7943bfa14 100644 --- a/Projects/AVRISP/Lib/TPI/TPITarget.c +++ b/Projects/AVRISP/Lib/XPROG/TPITarget.c @@ -320,7 +320,7 @@ bool TPITarget_WaitWhileNVMBusBusy(void) /* Poll the STATUS register to check to see if NVM access has been enabled */ while (TimeoutMS) { - /* Send the LDCS command to read the TPI STATUS register to see the NVM bus is active */ + /* Send the SLDCS command to read the TPI STATUS register to see the NVM bus is active */ TPITarget_SendByte(TPI_CMD_SLDCS | TPI_STATUS_REG); if (TPITarget_ReceiveByte() & TPI_STATUS_NVM) return true; diff --git a/Projects/AVRISP/Lib/TPI/TPITarget.h b/Projects/AVRISP/Lib/XPROG/TPITarget.h similarity index 100% rename from Projects/AVRISP/Lib/TPI/TPITarget.h rename to Projects/AVRISP/Lib/XPROG/TPITarget.h diff --git a/Projects/AVRISP/Lib/PDI/XMEGANVM.c b/Projects/AVRISP/Lib/XPROG/XMEGANVM.c similarity index 100% rename from Projects/AVRISP/Lib/PDI/XMEGANVM.c rename to Projects/AVRISP/Lib/XPROG/XMEGANVM.c diff --git a/Projects/AVRISP/Lib/PDI/XMEGANVM.h b/Projects/AVRISP/Lib/XPROG/XMEGANVM.h similarity index 100% rename from Projects/AVRISP/Lib/PDI/XMEGANVM.h rename to Projects/AVRISP/Lib/XPROG/XMEGANVM.h diff --git a/Projects/AVRISP/makefile b/Projects/AVRISP/makefile index 6f8ee40311..12f31546e2 100644 --- a/Projects/AVRISP/makefile +++ b/Projects/AVRISP/makefile @@ -131,12 +131,13 @@ SRC = $(TARGET).c \ Lib/V2ProtocolParams.c \ Lib/ISP/ISPProtocol.c \ Lib/ISP/ISPTarget.c \ - Lib/PDI/PDIProtocol.c \ - Lib/PDI/PDITarget.c \ - Lib/PDI/XMEGANVM.c \ - Lib/TPI/TPIProtocol.c \ - Lib/TPI/TPITarget.c \ - Lib/TPI/TINYNVM.c \ + Lib/XPROG/PDIProtocol.c \ + Lib/XPROG/PDITarget.c \ + Lib/XPROG/XMEGANVM.c \ + Lib/XPROG/TPIProtocol.c \ + Lib/XPROG/TPITarget.c \ + Lib/XPROG/TINYNVM.c \ + $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c \ $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c \ $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c \ $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c \