diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-12-26 04:13:55 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-12-26 04:13:55 +0000 |
commit | d1608d4af321529f0ddef9defcd97669ae9018c3 (patch) | |
tree | 79a2ba0fe2bfa14670a489e77f4c201f380de4f0 /Projects/AVRISP/Lib/XPROG/TINYNVM.c | |
parent | 35dac470f243d234d72f34cbaeb1d6c8a15bc435 (diff) | |
download | lufa-d1608d4af321529f0ddef9defcd97669ae9018c3.tar.gz lufa-d1608d4af321529f0ddef9defcd97669ae9018c3.tar.bz2 lufa-d1608d4af321529f0ddef9defcd97669ae9018c3.zip |
Added const where possible to the source functions in the Projects directory.
Added command timeout to the AVRISP project so that incorrectly connected targets no longer freeze the device.
Removed string descriptors from the TeensyHID bootloader to reduce its size.
Diffstat (limited to 'Projects/AVRISP/Lib/XPROG/TINYNVM.c')
-rw-r--r-- | Projects/AVRISP/Lib/XPROG/TINYNVM.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/Projects/AVRISP/Lib/XPROG/TINYNVM.c b/Projects/AVRISP/Lib/XPROG/TINYNVM.c index f4b90ffa5..3ddd2eda0 100644 --- a/Projects/AVRISP/Lib/XPROG/TINYNVM.c +++ b/Projects/AVRISP/Lib/XPROG/TINYNVM.c @@ -37,6 +37,7 @@ #include "TINYNVM.h"
#if defined(ENABLE_XPROG_PROTOCOL) || defined(__DOXYGEN__)
+#warning TPI Protocol support is currently incomplete and is not suitable for general use.
/** Busy-waits while the NVM controller is busy performing a NVM operation, such as a FLASH page read.
*
@@ -44,24 +45,13 @@ */
bool TINYNVM_WaitWhileNVMBusBusy(void)
{
- TCNT0 = 0;
- TIFR0 = (1 << OCF1A);
-
- uint8_t TimeoutMS = TINY_NVM_BUSY_TIMEOUT_MS;
-
/* Poll the STATUS register to check to see if NVM access has been enabled */
- while (TimeoutMS)
+ while (TimeoutMSRemaining)
{
/* 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);
if (XPROGTarget_ReceiveByte() & TPI_STATUS_NVM)
return true;
-
- if (TIFR0 & (1 << OCF1A))
- {
- TIFR0 = (1 << OCF1A);
- TimeoutMS--;
- }
}
return false;
|