Added INVERTED_ISP_MISO compile time option to the AVRISP-MKII clone project (thanks to Chuck Rohs).

This commit is contained in:
Dean Camera 2011-10-30 14:12:11 +00:00
parent 1e0c3bc69a
commit eb5b8a32e4
4 changed files with 22 additions and 0 deletions

View file

@ -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