aboutsummaryrefslogtreecommitdiff
path: root/Projects
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2010-06-25 13:19:05 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2010-06-25 13:19:05 +0000
commit802bea644de9309353cae1a8477108e17687a0a7 (patch)
treed575d799e6583cb0889bc89939246b23c9f59373 /Projects
parent62de5bcd93a6823d3c7fca978cb15b9e7e6470ab (diff)
Make loops in AVRISP-MKII Clone project's XPROG protocol infinite rather than looping on the timeout value, as this is already checked inside the loop anyway.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1353 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Projects')
-rw-r--r--Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c8
-rw-r--r--Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c8
-rw-r--r--Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c2
3 files changed, 4 insertions, 14 deletions
diff --git a/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c b/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
index f9815043..e0e2479e 100644
--- a/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
+++ b/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
@@ -77,7 +77,7 @@ static void TINYNVM_SendWriteNVMRegister(const uint8_t Address)
bool TINYNVM_WaitWhileNVMBusBusy(void)
{
/* Poll the STATUS register to check to see if NVM access has been enabled */
- while (TimeoutMSRemaining)
+ for (;;)
{
/* Send the SLDCS command to read the TPI STATUS register to see the NVM bus is active */
XPROGTarget_SendByte(TPI_CMD_SLDCS | TPI_STATUS_REG);
@@ -95,8 +95,6 @@ bool TINYNVM_WaitWhileNVMBusBusy(void)
return true;
}
}
-
- return false;
}
/** Waits while the target's NVM controller is busy performing an operation, exiting if the
@@ -107,7 +105,7 @@ bool TINYNVM_WaitWhileNVMBusBusy(void)
bool TINYNVM_WaitWhileNVMControllerBusy(void)
{
/* Poll the STATUS register to check to see if NVM access has been enabled */
- while (TimeoutMSRemaining)
+ for (;;)
{
/* Send the SIN command to read the TPI STATUS register to see the NVM bus is busy */
TINYNVM_SendReadNVMRegister(XPROG_Param_NVMCSRRegAddr);
@@ -125,8 +123,6 @@ bool TINYNVM_WaitWhileNVMControllerBusy(void)
return true;
}
}
-
- return false;
}
/** Reads memory from the target's memory spaces.
diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c b/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
index 150ad3eb..2caee6a8 100644
--- a/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
+++ b/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
@@ -72,7 +72,7 @@ static void XMEGANVM_SendNVMRegAddress(const uint8_t Register)
bool XMEGANVM_WaitWhileNVMBusBusy(void)
{
/* Poll the STATUS register to check to see if NVM access has been enabled */
- while (TimeoutMSRemaining)
+ for (;;)
{
/* Send the LDCS command to read the PDI STATUS register to see the NVM bus is active */
XPROGTarget_SendByte(PDI_CMD_LDCS | PDI_STATUS_REG);
@@ -90,8 +90,6 @@ bool XMEGANVM_WaitWhileNVMBusBusy(void)
return true;
}
}
-
- return false;
}
/** Waits while the target's NVM controller is busy performing an operation, exiting if the
@@ -102,7 +100,7 @@ bool XMEGANVM_WaitWhileNVMBusBusy(void)
bool XMEGANVM_WaitWhileNVMControllerBusy(void)
{
/* Poll the NVM STATUS register while the NVM controller is busy */
- while (TimeoutMSRemaining)
+ for (;;)
{
/* Send a LDS command to read the NVM STATUS register to check the BUSY flag */
XPROGTarget_SendByte(PDI_CMD_LDS | (PDI_DATSIZE_4BYTES << 2));
@@ -121,8 +119,6 @@ bool XMEGANVM_WaitWhileNVMControllerBusy(void)
return true;
}
}
-
- return false;
}
/** Retrieves the CRC value of the given memory space.
diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c b/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
index 5598791a..07efbb1d 100644
--- a/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
+++ b/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
@@ -192,8 +192,6 @@ static void XPROGTarget_SetTxMode(void)
UCSR1B &= ~(1 << RXEN1);
UCSR1B |= (1 << TXEN1);
-
- IsSending = true;
if (TimeoutMSRemaining)
TimeoutMSRemaining = COMMAND_TIMEOUT_MS;