*\r
* <b><sup>1</sup></b> <i>Optional, see \ref SSec_Options section - for USB AVRs with ADC modules only</i> \n\r
* <b><sup>2</sup></b> <i>When XPROG_VIA_HARDWARE_USART is set, the AVR's Tx and Rx become the DATA line when connected together\r
- * via a pair of 300 ohm resistors, and the AVR's XCK pin becomes CLOCK.</i> \n\r
+ * via a pair of 220 ohm resistors, and the AVR's XCK pin becomes CLOCK.</i> \n\r
* <b><sup>3</sup></b> <i>See AUX line related tokens in the \ref SSec_Options section</i>\r
*\r
* \section Sec_TPI TPI Connections\r
*\r
* <b><sup>1</sup></b> <i>Optional, see \ref SSec_Options section - for USB AVRs with ADC modules only</i> \n\r
* <b><sup>2</sup></b> <i>When XPROG_VIA_HARDWARE_USART is set, the AVR's Tx and Rx become the DATA line when connected together\r
- * via a pair of 300 ohm resistors, and the AVR's XCK pin becomes CLOCK.</i> \n\r
+ * via a pair of 220 ohm resistors, and the AVR's XCK pin becomes CLOCK.</i> \n\r
* <b><sup>3</sup></b> <i>See AUX line related tokens in the \ref SSec_Options section</i>\r
*\r
* \section SSec_Options Project Options\r
return true;\r
}\r
\r
-/** Writes byte addressed memory to the target's memory spaces.\r
+/** Writes word addressed memory to the target's memory spaces.\r
*\r
* \param[in] WriteAddress Start address to write to within the target's address space\r
* \param[in] WriteBuffer Buffer to source data from\r
- * \param[in] WriteLength Total number of bytes to write to the device\r
+ * \param[in] WriteLength Total number of bytes to write to the device (must be an integer multiple of 2)\r
*\r
* \return Boolean true if the command sequence complete successfully\r
*/\r
/* Wait until the NVM controller is no longer busy */\r
if (!(TINYNVM_WaitWhileNVMControllerBusy()))\r
return false;\r
+ \r
+ /* Must have an integer number of words to write - if extra bytes, abort programming */\r
+ if (WriteLength & 0x01)\r
+ return false;\r
\r
/* Set the NVM control register to the WORD WRITE command for memory reading */\r
TINYNVM_SendWriteNVMRegister(XPROG_Param_NVMCMDRegAddr);\r
/* Send the address of the location to write to */\r
TINYNVM_SendPointerAddress(WriteAddress);\r
\r
- while (WriteLength--)\r
+ while (WriteLength)\r
{\r
- /* Write the byte of data to the target */\r
+ /* Wait until the NVM controller is no longer busy */\r
+ if (!(TINYNVM_WaitWhileNVMControllerBusy()))\r
+ return false;\r
+\r
+ /* Write the low byte of data to the target */\r
XPROGTarget_SendByte(TPI_CMD_SST | TPI_POINTER_INDIRECT_PI);\r
XPROGTarget_SendByte(*(WriteBuffer++));\r
+ \r
+ /* Write the high byte of data to the target */\r
+ XPROGTarget_SendByte(TPI_CMD_SST | TPI_POINTER_INDIRECT_PI);\r
+ XPROGTarget_SendByte(*(WriteBuffer++));\r
+\r
+ /* Need to decrement the write length twice, since we read out a whole word */\r
+ WriteLength -= 2;\r
}\r
\r
return true;\r
{.Extension = "gif", .MIMEType = "image/gif"},\r
{.Extension = "bmp", .MIMEType = "image/bmp"},\r
{.Extension = "png", .MIMEType = "image/png"},\r
+ {.Extension = "ico", .MIMEType = "image/x-icon"},\r
{.Extension = "exe", .MIMEType = "application/octet-stream"},\r
{.Extension = "gz", .MIMEType = "application/x-gzip"},\r
- {.Extension = "ico", .MIMEType = "image/x-icon"},\r
{.Extension = "zip", .MIMEType = "application/zip"},\r
{.Extension = "pdf", .MIMEType = "application/pdf"},\r
};\r
AppState->CurrentState = AppState->NextState;\r
}\r
\r
- if (uip_rexmit() || uip_newdata() || uip_acked() || uip_connected() || uip_poll())\r
+ if (uip_rexmit() || uip_acked() || uip_newdata() || uip_connected() || uip_poll())\r
{\r
switch (AppState->CurrentState)\r
{\r