diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2011-10-30 14:12:11 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2011-10-30 14:12:11 +0000 |
commit | eb5b8a32e4d254479b14c82d36de8e17218640c4 (patch) | |
tree | 0573915f86d79471606ae7e9448c58d65f9d6629 /Projects/AVRISP-MKII | |
parent | 1e0c3bc69a75a835931f5943ce7157f6af97b15f (diff) | |
download | lufa-eb5b8a32e4d254479b14c82d36de8e17218640c4.tar.gz lufa-eb5b8a32e4d254479b14c82d36de8e17218640c4.tar.bz2 lufa-eb5b8a32e4d254479b14c82d36de8e17218640c4.zip |
Added INVERTED_ISP_MISO compile time option to the AVRISP-MKII clone project (thanks to Chuck Rohs).
Diffstat (limited to 'Projects/AVRISP-MKII')
-rw-r--r-- | Projects/AVRISP-MKII/AVRISP-MKII.txt | 6 | ||||
-rw-r--r-- | Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h | 14 | ||||
-rw-r--r-- | Projects/AVRISP-MKII/makefile | 1 |
3 files changed, 21 insertions, 0 deletions
diff --git a/Projects/AVRISP-MKII/AVRISP-MKII.txt b/Projects/AVRISP-MKII/AVRISP-MKII.txt index c47a65e68..4533a8535 100644 --- a/Projects/AVRISP-MKII/AVRISP-MKII.txt +++ b/Projects/AVRISP-MKII/AVRISP-MKII.txt @@ -293,6 +293,12 @@ * <td>Define to move the ISP rescue clock to the AVR's XCK pin instead of the OCR1A output pin. This is useful for existing programming * hardware that does not expose the OCR1A pin of the AVR, but *may* cause some issues with PDI programming mode. * </tr> + * <tr> + * <td>INVERTED_ISP_MISO</td> + * <td>Makefile LUFA_OPTS</td> + * <td>Define to invert the received data on the ISP MISO line. This is sometimes needed depending on the level translation hardware used, + * if the translator hardware inverts the received logic level. + * </tr> * </table> */ diff --git a/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h b/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h index 906ee82fb..350283f5e 100644 --- a/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h +++ b/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h @@ -104,10 +104,17 @@ */ static inline uint8_t ISPTarget_ReceiveByte(void) { + #if !defined(INVERTED_ISP_MISO) if (HardwareSPIMode) return SPI_ReceiveByte(); else return ISPTarget_TransferSoftSPIByte(0x00); + #else + if (HardwareSPIMode) + return ~SPI_ReceiveByte(); + else + return ~ISPTarget_TransferSoftSPIByte(0x00); + #endif } /** Sends and receives a byte of ISP data to and from the attached target, using the @@ -119,10 +126,17 @@ */ static inline uint8_t ISPTarget_TransferByte(const uint8_t Byte) { + #if !defined(INVERTED_ISP_MISO) if (HardwareSPIMode) return SPI_TransferByte(Byte); else return ISPTarget_TransferSoftSPIByte(Byte); + #else + if (HardwareSPIMode) + return ~SPI_TransferByte(Byte); + else + return ~ISPTarget_TransferSoftSPIByte(Byte); + #endif } #endif diff --git a/Projects/AVRISP-MKII/makefile b/Projects/AVRISP-MKII/makefile index 80d50bac6..10b3c7525 100644 --- a/Projects/AVRISP-MKII/makefile +++ b/Projects/AVRISP-MKII/makefile @@ -144,6 +144,7 @@ LUFA_OPTS += -D VTARGET_SCALE_FACTOR=1 #LUFA_OPTS += -D NO_VTARGET_DETECT #LUFA_OPTS += -D LIBUSB_DRIVER_COMPAT #LUFA_OPTS += -D XCK_RESCUE_CLOCK_ENABLE +#LUFA_OPTS += -D INVERTED_ISP_MISO # Create the LUFA source path variables by including the LUFA root makefile |