Commit ec6fbb21 authored by Dean Camera's avatar Dean Camera
Browse files

Make TPI writes add a dummy high byte if the data isn't word-aligned.

parent b736a5ef
...@@ -155,9 +155,9 @@ bool TINYNVM_WriteMemory(const uint16_t WriteAddress, const uint8_t* WriteBuffer ...@@ -155,9 +155,9 @@ bool TINYNVM_WriteMemory(const uint16_t WriteAddress, const uint8_t* WriteBuffer
if (!(TINYNVM_WaitWhileNVMControllerBusy())) if (!(TINYNVM_WaitWhileNVMControllerBusy()))
return false; 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) if (WriteLength & 0x01)
return false; WriteBuffer[WriteLength++] = 0xFF;
/* Set the NVM control register to the WORD WRITE command for memory reading */ /* Set the NVM control register to the WORD WRITE command for memory reading */
TINYNVM_SendWriteNVMRegister(XPROG_Param_NVMCMDRegAddr); TINYNVM_SendWriteNVMRegister(XPROG_Param_NVMCMDRegAddr);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment