aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/AVRISP-MKII
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2013-10-27 18:15:03 +0100
committerDean Camera <dean@fourwalledcubicle.com>2013-10-27 18:15:03 +0100
commitcf41d16bc709c31d7ee8af0432256c8c8a3b4469 (patch)
treeab6569577915645f0edb52b0f7efddd1754f3555 /Projects/AVRISP-MKII
parent7024bb4c799b3573627323fa1305142739ed3500 (diff)
downloadlufa-cf41d16bc709c31d7ee8af0432256c8c8a3b4469.tar.gz
lufa-cf41d16bc709c31d7ee8af0432256c8c8a3b4469.tar.bz2
lufa-cf41d16bc709c31d7ee8af0432256c8c8a3b4469.zip
Only issue the REPEAT instruction in the clone programmer if needed to reduce protocol overhead.
Diffstat (limited to 'Projects/AVRISP-MKII')
-rw-r--r--Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c b/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
index 06a4f7222..43c540e17 100644
--- a/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
+++ b/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
@@ -240,9 +240,12 @@ bool XMEGANVM_ReadMemory(const uint32_t ReadAddress,
XPROGTarget_SendByte(PDI_CMD_ST | (PDI_POINTER_DIRECT << 2) | PDI_DATSIZE_4BYTES);
XMEGANVM_SendAddress(ReadAddress);
- /* Send the REPEAT command with the specified number of bytes to read */
- XPROGTarget_SendByte(PDI_CMD_REPEAT | PDI_DATSIZE_1BYTE);
- XPROGTarget_SendByte(ReadSize - 1);
+ if (ReadSize > 1)
+ {
+ /* Send the REPEAT command with the specified number of bytes to read */
+ XPROGTarget_SendByte(PDI_CMD_REPEAT | PDI_DATSIZE_1BYTE);
+ XPROGTarget_SendByte(ReadSize - 1);
+ }
/* Send a LD command with indirect access and post-increment to read out the bytes */
XPROGTarget_SendByte(PDI_CMD_LD | (PDI_POINTER_INDIRECT_PI << 2) | PDI_DATSIZE_1BYTE);