/* 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
- return true;\r
+ return (TimeoutMSRemaining != 0);\r
}\r
\r
/** Writes word addressed memory to the target's memory spaces.\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
/* 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
- return true;\r
+ return (TimeoutMSRemaining != 0);\r
}\r
\r
/** Writes byte addressed memory to the target's memory spaces.\r