* - Added new EVENT_USB_Device_StartOfFrame() event, controlled by the new USB_Device_EnableSOFEvents() and\r
* USB_Device_DisableSOFEvents() macros to give bus-synchronised millisecond interrupts when in USB device mode\r
* - Added new Endpoint_SetEndpointDirection() macro for bi-directional endpoints\r
- * - Added new AVRISP project, a LUFA clone of the Atmel AVRISP-MKII programmer\r
+ * - Added new AVRISP project, a LUFA powered clone of the Atmel AVRISP-MKII programmer\r
* - Added ShutDown functions for all hardware peripheral drivers, so that peripherals can be turned off after use\r
* \r
* <b>Changed:</b>\r
* causing continuous USART receive interrupts\r
* - Fixed misspelt event name in the Class driver USBtoSerial demo, preventing correct operation\r
* - Fixed invalid data being returned when a GetStatus request is issued in Device mode with an unhandled data recipient\r
+ * - Added hardware USART receive interrupt and software buffering to the Benito project to ensure received data is not\r
+ * missed or corrupted\r
*\r
*\r
* \section Sec_ChangeLog090810 Version 090810\r
\r
/* Paged mode memory programming */\r
for (uint16_t CurrentByte = 0; CurrentByte < Write_Memory_Params.BytesToWrite; CurrentByte++)\r
- {\r
+ { \r
+ /* Check if the endpoint bank is currently empty */\r
+ if (!(Endpoint_IsReadWriteAllowed()))\r
+ {\r
+ Endpoint_ClearOUT();\r
+ Endpoint_WaitUntilReady();\r
+ } \r
+\r
bool IsOddByte = (CurrentByte & 0x01);\r
uint8_t ByteToWrite = Endpoint_Read_Byte();\r
\r
if (IsOddByte && (V2Command == CMD_PROGRAM_FLASH_ISP))\r
- Write_Memory_Params.ProgrammingCommands[0] ^= READ_WRITE_HIGH_BYTE_MASK;\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
Write_Memory_Params.ProgrammingCommands[2] |= READ_WRITE_HIGH_BYTE_MASK;\r
\r
PollAddress = (CurrentAddress & 0xFFFF); \r
- }\r
- \r
- /* Check if the endpoint bank is currently empty */\r
- if (!(Endpoint_IsReadWriteAllowed()))\r
- {\r
- Endpoint_ClearOUT();\r
- Endpoint_WaitUntilReady();\r
- } \r
+ } \r
\r
if (IsOddByte || (V2Command == CMD_PROGRAM_EEPROM_ISP))\r
CurrentAddress++;\r
/* Word/byte mode memory programming */\r
for (uint16_t CurrentByte = 0; CurrentByte < Write_Memory_Params.BytesToWrite; CurrentByte++)\r
{\r
+ /* Check if the endpoint bank is currently empty */\r
+ if (!(Endpoint_IsReadWriteAllowed()))\r
+ {\r
+ Endpoint_ClearOUT();\r
+ Endpoint_WaitUntilReady();\r
+ } \r
+\r
bool IsOddByte = (CurrentByte & 0x01);\r
uint8_t ByteToWrite = Endpoint_Read_Byte();\r
\r
if (IsOddByte && (V2Command == CMD_READ_FLASH_ISP))\r
- Write_Memory_Params.ProgrammingCommands[0] ^= READ_WRITE_HIGH_BYTE_MASK;\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
\r
PollAddress = (CurrentAddress & 0xFFFF);\r
}\r
- \r
- /* Check if the endpoint bank is currently empty */\r
- if (!(Endpoint_IsReadWriteAllowed()))\r
- {\r
- Endpoint_ClearOUT();\r
- Endpoint_WaitUntilReady();\r
- } \r
\r
if (IsOddByte || (V2Command == CMD_PROGRAM_EEPROM_ISP))\r
CurrentAddress++;\r
\r
for (uint16_t CurrentByte = 0; CurrentByte < Read_Memory_Params.BytesToRead; CurrentByte++)\r
{\r
- if ((V2Command == CMD_READ_FLASH_ISP) && (CurrentByte & 0x01))\r
- Read_Memory_Params.ReadMemoryCommand ^= READ_WRITE_HIGH_BYTE_MASK;\r
+ bool IsOddByte = (CurrentByte & 0x01);\r
+\r
+ if (IsOddByte && (V2Command == CMD_READ_FLASH_ISP))\r
+ Read_Memory_Params.ReadMemoryCommand |= READ_WRITE_HIGH_BYTE_MASK;\r
+ else\r
+ Read_Memory_Params.ReadMemoryCommand &= ~READ_WRITE_HIGH_BYTE_MASK;\r
\r
SPI_SendByte(Read_Memory_Params.ReadMemoryCommand);\r
SPI_SendByte(CurrentAddress >> 8);\r
Endpoint_WaitUntilReady();\r
}\r
\r
- if (((V2Command == CMD_READ_FLASH_ISP) && (CurrentByte & 0x01)) || (V2Command == CMD_READ_EEPROM_ISP))\r
+ if ((IsOddByte && (V2Command == CMD_READ_FLASH_ISP)) || (V2Command == CMD_READ_EEPROM_ISP))\r
CurrentAddress++;\r
}\r
\r