projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added INVERTED_ISP_MISO compile time option to the AVRISP-MKII clone project (thanks...
[pub/USBasp.git]
/
Projects
/
AVRISP-MKII
/
Lib
/
ISP
/
ISPTarget.h
diff --git
a/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h
b/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h
index
906ee82
..
350283f
100644
(file)
--- 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)
{
*/
static inline uint8_t ISPTarget_ReceiveByte(void)
{
+ #if !defined(INVERTED_ISP_MISO)
if (HardwareSPIMode)
return SPI_ReceiveByte();
else
return ISPTarget_TransferSoftSPIByte(0x00);
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
}
/** 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)
{
*/
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);
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
}
#endif