\r
/* AVR FLASH addressing requires us to modify the write command based on if we are writing a high\r
* or low byte at the current word address */\r
- Write_Memory_Params.ProgrammingCommands[0] ^= READ_WRITE_HIGH_BYTE_MASK;\r
+ if (V2Command == CMD_PROGRAM_FLASH_ISP)\r
+ Write_Memory_Params.ProgrammingCommands[0] ^= READ_WRITE_HIGH_BYTE_MASK;\r
\r
/* Check to see the write completion method, to see if we have a valid polling address */\r
if (!(PollAddress) && (ByteToWrite != PollValue))\r
{\r
if (IsOddByte && (V2Command == CMD_PROGRAM_FLASH_ISP))\r
Write_Memory_Params.ProgrammingCommands[2] |= READ_WRITE_HIGH_BYTE_MASK;\r
- \r
+\r
PollAddress = (CurrentAddress & 0xFFFF); \r
} \r
\r
{\r
bool IsOddByte = (CurrentByte & 0x01);\r
uint8_t ByteToWrite = *(NextWriteByte++);\r
- \r
- if (IsOddByte && (V2Command == CMD_READ_FLASH_ISP))\r
- Write_Memory_Params.ProgrammingCommands[0] |= READ_WRITE_HIGH_BYTE_MASK;\r
- else\r
- Write_Memory_Params.ProgrammingCommands[0] &= ~READ_WRITE_HIGH_BYTE_MASK; \r
\r
SPI_SendByte(Write_Memory_Params.ProgrammingCommands[0]);\r
SPI_SendByte(CurrentAddress >> 8);\r
SPI_SendByte(CurrentAddress & 0xFF);\r
SPI_SendByte(ByteToWrite);\r
\r
+ /* AVR FLASH addressing requires us to modify the write command based on if we are writing a high\r
+ * or low byte at the current word address */\r
+ if (V2Command == CMD_PROGRAM_FLASH_ISP)\r
+ Write_Memory_Params.ProgrammingCommands[0] ^= READ_WRITE_HIGH_BYTE_MASK;\r
+\r
if (ByteToWrite != PollValue)\r
{\r
if (IsOddByte && (V2Command == CMD_PROGRAM_FLASH_ISP))\r