diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-12-15 00:14:17 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-12-15 00:14:17 +0000 |
commit | a7880ac1cdbfe8ddaf957173bc08f334aad8bca7 (patch) | |
tree | b2119bd8eaa823940abda4ce596ff195d9bf84f1 /Projects/AVRISP/Lib/PDIProtocol.c | |
parent | bb3879331211a19c3adc3927cac870cc7e36b775 (diff) | |
download | lufa-a7880ac1cdbfe8ddaf957173bc08f334aad8bca7.tar.gz lufa-a7880ac1cdbfe8ddaf957173bc08f334aad8bca7.tar.bz2 lufa-a7880ac1cdbfe8ddaf957173bc08f334aad8bca7.zip |
Fix error in AVRISP programmer when repeatedly using PDI mode via the hardware USART due to the SendByte routine not clearing the Transmit Complete USART flag.
Diffstat (limited to 'Projects/AVRISP/Lib/PDIProtocol.c')
-rw-r--r-- | Projects/AVRISP/Lib/PDIProtocol.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Projects/AVRISP/Lib/PDIProtocol.c b/Projects/AVRISP/Lib/PDIProtocol.c index 24ce26cb6..46d6dd417 100644 --- a/Projects/AVRISP/Lib/PDIProtocol.c +++ b/Projects/AVRISP/Lib/PDIProtocol.c @@ -181,7 +181,8 @@ static void PDIProtocol_Erase(void) else if (Erase_XPROG_Params.MemoryType == XPRG_ERASE_USERSIG)
EraseCommand = NVM_CMD_ERASEUSERSIG;
- NVMTarget_EraseMemory(EraseCommand, Erase_XPROG_Params.Address);
+ if (!(NVMTarget_EraseMemory(EraseCommand, Erase_XPROG_Params.Address)))
+ ReturnStatus = XPRG_ERR_TIMEOUT;
Endpoint_Write_Byte(CMD_XPROG);
Endpoint_Write_Byte(XPRG_CMD_ERASE);
@@ -241,7 +242,9 @@ static void PDIProtocol_ReadMemory(void) Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
uint8_t ReadBuffer[ReadMemory_XPROG_Params.Length];
- NVMTarget_ReadMemory(ReadMemory_XPROG_Params.Address, ReadBuffer, ReadMemory_XPROG_Params.Length);
+
+ if (!(NVMTarget_ReadMemory(ReadMemory_XPROG_Params.Address, ReadBuffer, ReadMemory_XPROG_Params.Length)))
+ ReturnStatus = XPRG_ERR_TIMEOUT;
Endpoint_Write_Byte(CMD_XPROG);
Endpoint_Write_Byte(XPRG_CMD_READ_MEM);
@@ -279,7 +282,8 @@ static void PDIProtocol_ReadCRC(void) else
CRCCommand = NVM_CMD_FLASHCRC;
- MemoryCRC = NVMTarget_GetMemoryCRC(CRCCommand);
+ if (!(NVMTarget_GetMemoryCRC(CRCCommand, &MemoryCRC)))
+ ReturnStatus = XPRG_ERR_TIMEOUT;
Endpoint_Write_Byte(CMD_XPROG);
Endpoint_Write_Byte(XPRG_CMD_CRC);
|