diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-06-25 13:19:05 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-06-25 13:19:05 +0000 |
commit | 016a4c068a01b0baf28bc45ec1eba16460689f9a (patch) | |
tree | d575d799e6583cb0889bc89939246b23c9f59373 /Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c | |
parent | 26afe5fe9e75a506805c155f8fa69000e0f92515 (diff) | |
download | lufa-016a4c068a01b0baf28bc45ec1eba16460689f9a.tar.gz lufa-016a4c068a01b0baf28bc45ec1eba16460689f9a.tar.bz2 lufa-016a4c068a01b0baf28bc45ec1eba16460689f9a.zip |
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.
Diffstat (limited to 'Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c')
-rw-r--r-- | Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c b/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c index 150ad3ebf..2caee6a87 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. |