projects
/
pub
/
USBasp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ceb16ee
)
Make sure that long reads are aborted early if the connection times out while waiting...
author
Dean Camera
<dean@fourwalledcubicle.com>
Fri, 30 Apr 2010 08:33:21 +0000
(08:33 +0000)
committer
Dean Camera
<dean@fourwalledcubicle.com>
Fri, 30 Apr 2010 08:33:21 +0000
(08:33 +0000)
Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
patch
|
blob
|
blame
|
history
Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
patch
|
blob
|
blame
|
history
Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
patch
|
blob
|
blame
|
history
diff --git
a/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
b/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
index
7b9ff09
..
acd6b65
100644
(file)
--- a/
Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
+++ b/
Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
@@
-164,14
+164,14
@@
bool TINYNVM_ReadMemory(const uint16_t ReadAddress, uint8_t* ReadBuffer, uint16_
/* Send the address of the location to read from */
\r
TINYNVM_SendPointerAddress(ReadAddress);
\r
\r
/* Send the address of the location to read from */
\r
TINYNVM_SendPointerAddress(ReadAddress);
\r
\r
- while (ReadSize--)
\r
+ while (ReadSize--
&& TimeoutMSRemaining
)
\r
{
\r
/* Read the byte of data from the target */
\r
XPROGTarget_SendByte(TPI_CMD_SLD | TPI_POINTER_INDIRECT_PI);
\r
*(ReadBuffer++) = XPROGTarget_ReceiveByte();
\r
}
\r
\r
{
\r
/* Read the byte of data from the target */
\r
XPROGTarget_SendByte(TPI_CMD_SLD | TPI_POINTER_INDIRECT_PI);
\r
*(ReadBuffer++) = XPROGTarget_ReceiveByte();
\r
}
\r
\r
- return
true
;
\r
+ return
(TimeoutMSRemaining != 0)
;
\r
}
\r
\r
/** Writes word addressed memory to the target's memory spaces.
\r
}
\r
\r
/** Writes word addressed memory to the target's memory spaces.
\r
diff --git
a/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
b/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
index
7ca0c5e
..
b6b039a
100644
(file)
--- a/
Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
+++ b/
Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
@@
-183,7
+183,7
@@
bool XMEGANVM_GetMemoryCRC(const uint8_t CRCCommand, uint32_t* const CRCDest)
for (uint8_t i = 0; i < XMEGA_CRC_LENGTH; i++)
\r
((uint8_t*)CRCDest)[i] = XPROGTarget_ReceiveByte();
\r
\r
for (uint8_t i = 0; i < XMEGA_CRC_LENGTH; i++)
\r
((uint8_t*)CRCDest)[i] = XPROGTarget_ReceiveByte();
\r
\r
- return
true
;
\r
+ return
(TimeoutMSRemaining != 0)
;
\r
}
\r
\r
/** Reads memory from the target's memory spaces.
\r
}
\r
\r
/** Reads memory from the target's memory spaces.
\r
@@
-215,10
+215,10
@@
bool XMEGANVM_ReadMemory(const uint32_t ReadAddress, uint8_t* ReadBuffer, uint16
\r
/* Send a LD command with indirect access and postincrement to read out the bytes */
\r
XPROGTarget_SendByte(PDI_CMD_LD | (PDI_POINTER_INDIRECT_PI << 2) | PDI_DATSIZE_1BYTE);
\r
\r
/* Send a LD command with indirect access and postincrement to read out the bytes */
\r
XPROGTarget_SendByte(PDI_CMD_LD | (PDI_POINTER_INDIRECT_PI << 2) | PDI_DATSIZE_1BYTE);
\r
- while (ReadSize--)
\r
+ while (ReadSize--
&& TimeoutMSRemaining
)
\r
*(ReadBuffer++) = XPROGTarget_ReceiveByte();
\r
\r
*(ReadBuffer++) = XPROGTarget_ReceiveByte();
\r
\r
- return
true
;
\r
+ return
(TimeoutMSRemaining != 0)
;
\r
}
\r
\r
/** Writes byte addressed memory to the target's memory spaces.
\r
}
\r
\r
/** Writes byte addressed memory to the target's memory spaces.
\r
diff --git
a/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
b/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
index
6f0d87a
..
e75adbe
100644
(file)
--- a/
Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
+++ b/
Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
@@
-338,6
+338,9
@@
uint8_t XPROGTarget_ReceiveByte(void)
}
\r
}
\r
\r
}
\r
}
\r
\r
+ if (TimeoutMSRemaining)
\r
+ TimeoutMSRemaining = COMMAND_TIMEOUT_MS;
\r
+
\r
return UDR1;
\r
#else
\r
/* Wait until a byte has been received before reading */
\r
return UDR1;
\r
#else
\r
/* Wait until a byte has been received before reading */
\r