From ec6fbb219fc95ffd5f6f9fffd84eeb5f3fd643a3 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Tue, 2 Feb 2010 03:27:28 +0000 Subject: Make TPI writes add a dummy high byte if the data isn't word-aligned. --- Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Projects') diff --git a/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c b/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c index 39cdf2e9c..47a265ace 100644 --- a/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c +++ b/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c @@ -155,9 +155,9 @@ bool TINYNVM_WriteMemory(const uint16_t WriteAddress, const uint8_t* WriteBuffer if (!(TINYNVM_WaitWhileNVMControllerBusy())) return false; - /* Must have an integer number of words to write - if extra bytes, abort programming */ + /* Must have an integer number of words to write - if extra byte, word-align via a dummy high byte */ if (WriteLength & 0x01) - return false; + WriteBuffer[WriteLength++] = 0xFF; /* Set the NVM control register to the WORD WRITE command for memory reading */ TINYNVM_SendWriteNVMRegister(XPROG_Param_NVMCMDRegAddr); -- cgit v1.2.3