aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-02-08 03:16:09 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-02-08 03:16:09 +0000
commit7ae91099e9b356d3f9fe14b41a53a6af1161690c (patch)
tree04d85c5425799a686b7448564a21556f7e56649b /Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
parent6a48efd3bd66a1f6b4e24a75881dac337e3c9c95 (diff)
downloadlufa-7ae91099e9b356d3f9fe14b41a53a6af1161690c.tar.gz
lufa-7ae91099e9b356d3f9fe14b41a53a6af1161690c.tar.bz2
lufa-7ae91099e9b356d3f9fe14b41a53a6af1161690c.zip
Fix AVRISP-MKII clone project's TPI Chip Erase command processing - ensure erase location is the high byte in the given address space, check NVMBUSY for completion rather than the NVM Bus Enable bit.
Change If-Else chains over to switch statements in XPROGProtocol.c for clarity.
Diffstat (limited to 'Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c')
-rw-r--r--Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c b/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
index f327a47e8..34ffb1e7b 100644
--- a/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
+++ b/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
@@ -204,13 +204,13 @@ bool TINYNVM_EraseMemory(const uint8_t EraseCommand, const uint16_t Address)
TINYNVM_SendWriteNVMRegister(XPROG_Param_NVMCMDRegAddr);
XPROGTarget_SendByte(EraseCommand);
- /* Write to a location within the target address space to start the erase process */
- TINYNVM_SendPointerAddress(Address);
+ /* Write to a high byte location within the target address space to start the erase process */
+ TINYNVM_SendPointerAddress(Address | 0x0001);
XPROGTarget_SendByte(TPI_CMD_SST | TPI_POINTER_INDIRECT);
XPROGTarget_SendByte(0x00);
- /* Wait until the NVM bus is ready again */
- if (!(TINYNVM_WaitWhileNVMBusBusy()))
+ /* Wait until the NVM controller is no longer busy */
+ if (!(TINYNVM_WaitWhileNVMControllerBusy()))
return false;
return true;