uint8_t PollValue;
uint8_t PollIndex;
uint8_t EnterProgBytes[4];
- } ATTR_PACKED Enter_ISP_Params;
+ } Enter_ISP_Params;
Endpoint_Read_Stream_LE(&Enter_ISP_Params, sizeof(Enter_ISP_Params), NULL);
{
uint8_t PreDelayMS;
uint8_t PostDelayMS;
- } ATTR_PACKED Leave_ISP_Params;
+ } Leave_ISP_Params;
Endpoint_Read_Stream_LE(&Leave_ISP_Params, sizeof(Leave_ISP_Params), NULL);
uint8_t ProgrammingCommands[3];
uint8_t PollValue1;
uint8_t PollValue2;
- uint8_t ProgData[256]; // Note, the Jungo driver has a very short ACK timeout period, need to buffer the
- } ATTR_PACKED Write_Memory_Params; // whole page and ACK the packet as fast as possible to prevent it from aborting
+ uint8_t ProgData[256]; // Note, the Jungo driver has a very short ACK timeout period, need to buffer the
+ } Write_Memory_Params; // whole page and ACK the packet as fast as possible to prevent it from aborting
Endpoint_Read_Stream_LE(&Write_Memory_Params, (sizeof(Write_Memory_Params) -
sizeof(Write_Memory_Params.ProgData)), NULL);
- Write_Memory_Params.BytesToWrite = be16_to_cpu(Write_Memory_Params.BytesToWrite);
+ Write_Memory_Params.BytesToWrite = SwapEndian_16(Write_Memory_Params.BytesToWrite);
if (Write_Memory_Params.BytesToWrite > sizeof(Write_Memory_Params.ProgData))
{
if (ProgrammingStatus != STATUS_CMD_OK)
break;
- /* Must reset the polling address afterwards, so it is not erronously used for the next byte */
+ /* Must reset the polling address afterwards, so it is not erroneously used for the next byte */
PollAddress = 0;
}
/* EEPROM just increments the address each byte, flash needs to increment on each word and
* also check to ensure that a LOAD EXTENDED ADDRESS command is issued each time the extended
- * address boundary has been crossed */
+ * address boundary has been crossed during FLASH memory programming */
if ((CurrentByte & 0x01) || (V2Command == CMD_PROGRAM_EEPROM_ISP))
{
CurrentAddress++;
- if ((V2Command != CMD_PROGRAM_EEPROM_ISP) && !(CurrentAddress & 0xFFFF))
+ if ((V2Command == CMD_PROGRAM_FLASH_ISP) && !(CurrentAddress & 0xFFFF))
MustLoadExtendedAddress = true;
}
}
{
uint16_t BytesToRead;
uint8_t ReadMemoryCommand;
- } ATTR_PACKED Read_Memory_Params;
+ } Read_Memory_Params;
Endpoint_Read_Stream_LE(&Read_Memory_Params, sizeof(Read_Memory_Params), NULL);
- Read_Memory_Params.BytesToRead = be16_to_cpu(Read_Memory_Params.BytesToRead);
+ Read_Memory_Params.BytesToRead = SwapEndian_16(Read_Memory_Params.BytesToRead);
Endpoint_ClearOUT();
Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
uint8_t EraseDelayMS;
uint8_t PollMethod;
uint8_t EraseCommandBytes[4];
- } ATTR_PACKED Erase_Chip_Params;
+ } Erase_Chip_Params;
Endpoint_Read_Stream_LE(&Erase_Chip_Params, sizeof(Erase_Chip_Params), NULL);
{
uint8_t RetByte;
uint8_t ReadCommandBytes[4];
- } ATTR_PACKED Read_FuseLockSigOSCCAL_Params;
+ } Read_FuseLockSigOSCCAL_Params;
Endpoint_Read_Stream_LE(&Read_FuseLockSigOSCCAL_Params, sizeof(Read_FuseLockSigOSCCAL_Params), NULL);
struct
{
uint8_t WriteCommandBytes[4];
- } ATTR_PACKED Write_FuseLockSig_Params;
+ } Write_FuseLockSig_Params;
Endpoint_Read_Stream_LE(&Write_FuseLockSig_Params, sizeof(Write_FuseLockSig_Params), NULL);
uint8_t RxBytes;
uint8_t RxStartAddr;
uint8_t TxData[255];
- } ATTR_PACKED SPI_Multi_Params;
+ } SPI_Multi_Params;
Endpoint_Read_Stream_LE(&SPI_Multi_Params, (sizeof(SPI_Multi_Params) - sizeof(SPI_Multi_Params.TxData)), NULL);
Endpoint_Read_Stream_LE(&SPI_Multi_Params.TxData, SPI_Multi_Params.TxBytes, NULL);