* with the rest of the library errorcodes\r
* - Make MIDI device demos also turn off the on board LEDs if MIDI Note On messages are sent with a velocity of zero,\r
* which some devices use instead of Note Off messages (thanks to Robin Green)\r
+ * - The CDC demos are now named "VirtualSerial" instead to indicate the demos' function rather than its implemented USB class,\r
+ * to reduce confusion and to be in line with the rest of the LUFA demos\r
*\r
* <b>Fixed:</b>\r
* - Added missing CDC_Host_CreateBlockingStream() function code to the CDC Host Class driver\r
* - Fixed TeensyHID bootloader not properly shutting down the USB interface to trigger a disconnection on the host before resetting\r
* - Fixed MassStorageHost Class driver demo not having USB_STREAM_TIMEOUT_MS compile time option set properly to prevent slow \r
* devices from timing out the data pipes\r
- * - Fixed the definition of the Endpoint_BytesInEndpoint() macro for the U4 parts\r
+ * - Fixed the definition of the Endpoint_BytesInEndpoint() macro for the U4 series AVR parts\r
*\r
* \section Sec_ChangeLog091122 Version 091122\r
*\r
*/\r
void PDITarget_SendByte(uint8_t Byte)\r
{\r
+ uint8_t LogicOneBits = 0;\r
+\r
+ // One Start Bit\r
PDIDATA_LINE_PORT &= ~PDIDATA_LINE_MASK;\r
\r
TOGGLE_PDI_CLOCK;\r
-\r
+ \r
+ // Eight Data Bits\r
for (uint8_t i = 0; i < 8; i++)\r
{\r
if (Byte & 0x01)\r
- PDIDATA_LINE_PORT &= ~PDIDATA_LINE_MASK;\r
+ {\r
+ PDIDATA_LINE_PORT &= ~PDIDATA_LINE_MASK;\r
+ LogicOneBits++;\r
+ }\r
else\r
- PDIDATA_LINE_PORT |= PDIDATA_LINE_MASK;\r
- \r
+ {\r
+ PDIDATA_LINE_PORT |= PDIDATA_LINE_MASK;\r
+ }\r
+ \r
Byte >>= 1;\r
\r
TOGGLE_PDI_CLOCK;\r
}\r
\r
- PDIDATA_LINE_PORT |= PDIDATA_LINE_MASK;\r
+ // Even Parity Bit\r
+ if (LogicOneBits & 0x01)\r
+ PDIDATA_LINE_PORT &= ~PDIDATA_LINE_MASK;\r
+ else\r
+ PDIDATA_LINE_PORT |= PDIDATA_LINE_MASK;\r
+\r
+ TOGGLE_PDI_CLOCK;\r
\r
+ // Two Stop Bits\r
+ PDIDATA_LINE_PORT |= PDIDATA_LINE_MASK;\r
+ \r
TOGGLE_PDI_CLOCK;\r
TOGGLE_PDI_CLOCK;\r
}\r
\r
PDIDATA_LINE_DDR &= ~PDIDATA_LINE_MASK;\r
\r
+ // One Start Bit\r
while (PDIDATA_LINE_PIN & PDIDATA_LINE_MASK);\r
TOGGLE_PDI_CLOCK;\r
- \r
+ \r
+ // Eight Data Bits\r
for (uint8_t i = 0; i < 8; i++)\r
{\r
if (PDIDATA_LINE_PIN & PDIDATA_LINE_MASK)\r
TOGGLE_PDI_CLOCK; \r
}\r
\r
+ // Even Parity Bit (discarded)\r
+ TOGGLE_PDI_CLOCK;\r
+\r
+ // Two Stop Bits\r
TOGGLE_PDI_CLOCK;\r
TOGGLE_PDI_CLOCK;\r
\r