X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/53eca61d02f296262011b802e80f145329ace34b..7ae91099e9b356d3f9fe14b41a53a6af1161690c:/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c diff --git a/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c b/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c index c7e64a5eb..34ffb1e7b 100644 --- a/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c +++ b/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c @@ -66,7 +66,7 @@ static void TINYNVM_SendReadNVMRegister(const uint8_t Address) */ static void TINYNVM_SendWriteNVMRegister(const uint8_t Address) { - /* The TPI command for writing to the I/O space uses wierd addressing, where the I/O address's upper + /* The TPI command for writing to the I/O space uses weird addressing, where the I/O address's upper * two bits of the 6-bit address are shifted left once */ XPROGTarget_SendByte(TPI_CMD_SOUT | ((Address & 0x30) << 1) | (Address & 0x0F)); } @@ -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;