\r
.Attributes = (ATTR_CAN_UPLOAD | ATTR_CAN_DOWNLOAD),\r
\r
- .DetachTimeout = 0x0000,\r
+ .DetachTimeout = 0x0000,\r
.TransferSize = 0x0c00,\r
\r
.DFUSpecification = VERSION_BCD(01.01)\r
*/\r
bool RunBootloader = true;\r
\r
-\r
/** Main program entry point. This routine configures the hardware required by the bootloader, then continuously \r
* runs the bootloader processing routine until instructed to soft-exit.\r
*/\r
{\r
Endpoint_ClearSETUP();\r
\r
- /* Wait until the command (report) has been sent by the host */\r
+ /* Wait until the command has been sent by the host */\r
while (!(Endpoint_IsOUTReceived()));\r
\r
/* Read in the write destination address */\r
boot_spm_busy_wait();\r
\r
/* Write each of the FLASH page's bytes in sequence */\r
- for (uint8_t PageByte = 0; PageByte < 128; PageByte += 2)\r
+ for (uint8_t PageByte = 0; PageByte < SPM_PAGESIZE; PageByte += 2)\r
{\r
/* Check if endpoint is empty - if so clear it and wait until ready for next packet */\r
if (!(Endpoint_BytesInEndpoint()))\r
{\r
ActionSent = true;\r
\r
- // Write the string to the virtual COM port via the created character stream\r
+ /* Write the string to the virtual COM port via the created character stream */\r
fputs(ReportString, &USBSerialStream);\r
\r
- // Alternatively, without the stream:\r
+ /* Alternatively, without the stream: */\r
// CDC_Device_SendString(&VirtualSerial_CDC_Interface, ReportString, strlen(ReportString));\r
}\r
}\r
SideShow Class demonstration application. This give a reference\r
for implementing Microsoft SideShow compatible devices in an\r
embedded environment. SideShow allows for gadget data displayed\r
- on a Vista machine to also be displayed on an externally connected\r
- interactive display. Upon enumeration on a Vista system, this will\r
+ on a Windows Vista or later machine to also be displayed on an\r
+ externally connected interactive display. Upon enumeration, this will\r
appear as a new SideShow device which can have gadgets loaded onto\r
it.\r
\r
this software.\r
*/\r
\r
+#define INCLUDE_FROM_SERIALSTREAM_C\r
#include "SerialStream.h"\r
\r
FILE USARTStream = FDEV_SETUP_STREAM(SerialStream_TxByte, SerialStream_RxByte, _FDEV_SETUP_RW);\r
\r
-int SerialStream_TxByte(char DataByte, FILE *Stream)\r
+static int SerialStream_TxByte(char DataByte, FILE *Stream)\r
{\r
Serial_TxByte(DataByte);\r
\r
return 0;\r
}\r
\r
-int SerialStream_RxByte(FILE *Stream)\r
+static int SerialStream_RxByte(FILE *Stream)\r
{\r
return Serial_RxByte();\r
}\r
extern FILE USARTStream;\r
\r
/* Function Prototypes: */\r
- int SerialStream_TxByte(char DataByte, FILE *Stream) ATTR_NON_NULL_PTR_ARG(2);\r
- int SerialStream_RxByte(FILE *Stream) ATTR_NON_NULL_PTR_ARG(1);\r
+ #if defined(INCLUDE_FROM_SERIALSTREAM_C)\r
+ static int SerialStream_TxByte(char DataByte, FILE *Stream) ATTR_NON_NULL_PTR_ARG(2);\r
+ static int SerialStream_RxByte(FILE *Stream) ATTR_NON_NULL_PTR_ARG(1);\r
+ #endif\r
#endif\r
\r
/* Public Interface - May be used in end-application: */\r
return;\r
}\r
\r
- UDADDR = ((1 << ADDEN) | DeviceAddress);\r
-\r
if (DeviceAddress)\r
USB_DeviceState = DEVICE_STATE_Addressed;\r
\r
+ UDADDR = ((1 << ADDEN) | DeviceAddress);\r
+\r
return;\r
}\r
\r
\r
Endpoint_ClearStatusStage();\r
\r
- if (USB_ConfigurationNumber)\r
- USB_DeviceState = DEVICE_STATE_Configured;\r
- else\r
- USB_DeviceState = DEVICE_STATE_Addressed;\r
+ USB_DeviceState = (USB_ConfigurationNumber) ? DEVICE_STATE_Configured : DEVICE_STATE_Addressed;\r
\r
EVENT_USB_Device_ConfigurationChanged();\r
}\r
int16_t UnicodeString[20];\r
} SignatureDescriptor;\r
\r
- SignatureDescriptor.Header.Size = sizeof(SignatureDescriptor);\r
- SignatureDescriptor.Header.Type = DTYPE_String;\r
+ SignatureDescriptor.Header.Type = DTYPE_String;\r
+ SignatureDescriptor.Header.Size = sizeof(SignatureDescriptor);\r
\r
- uint8_t SigReadAddress = 0x0E;\r
+ uint8_t SigReadAddress = 0x0E;\r
\r
for (uint8_t SerialCharNum = 0; SerialCharNum < 20; SerialCharNum++)\r
{\r
\r
if (Endpoint_IsEnabled())\r
{ \r
- if (USB_ControlRequest.bRequest == REQ_ClearFeature)\r
+ if (USB_ControlRequest.bRequest == REQ_SetFeature)\r
{\r
- Endpoint_ClearStall();\r
- Endpoint_ResetFIFO(EndpointIndex);\r
- Endpoint_ResetDataToggle();\r
+ Endpoint_StallTransaction();\r
}\r
else\r
{\r
- Endpoint_StallTransaction();\r
- }\r
+ Endpoint_ClearStall();\r
+ Endpoint_ResetFIFO(EndpointIndex);\r
+ Endpoint_ResetDataToggle();\r
+ } \r
}\r
}\r
\r
* - Added new Joystick Host ClassDriver and LowLevel demos\r
* - Added new Printer Host mode Class driver\r
* - Added new Printer Host mode ClassDriver demo\r
- * - Added optional support for double banked endpoints in the Device mode Class drivers\r
- * - Added new stream creation function to the CDC Class drivers, to easily make standard streams from CDC Class driver instances\r
+ * - Added optional support for double banked endpoints and pipes in the Device and Host mode Class drivers\r
+ * - Added new stream creation function to the CDC Class drivers, to easily make standard I/O streams from CDC Class driver instances\r
*\r
* <b>Changed:</b>\r
* - Removed mostly useless "TestApp" demo, as it was mainly useful only for checking for sytax errors in the library\r
* - MIDI device demos now receive MIDI events from the host and display note ON messages via the board LEDs\r
- * - Cleanups to the Device mode Mass Storage demo applications' SCSI routines\r
+ * - Cleanups to the Device mode Mass Storage demo application SCSI routines\r
* - Changed Audio Class driver sample read/write functions to be inline, to reduce the number of cycles needed to transfer\r
* samples to and from the device (allowing more time for sample processing and output)\r
* - Audio class Device mode demos now work at both 16MHz and 8MHz, rather than just at 8MHz\r
* - ATAVRUSBRF01\r
* - XPLAIN (AT90USB1287 only)\r
*\r
- * Currently supported third-party boards:\r
+ * Currently supported third-party board (via hardware drivers):\r
* - BUMBLEB (using officially recommended peripheral layout)\r
* - Any Other Custom User Boards (with Board Drivers, \see Page_WritingBoardDrivers)\r
*/\r
* or post your suggestion as an enhancement request to the project bug tracker.\r
*\r
* <b>Targeted for the Next Release (SVN Development Only):</b>\r
- * - Add hub support to match Atmel's stack\r
- * - Add ability to get number of bytes not written with pipe/endpoint write routines after an error\r
*\r
* <b>Targeted for Future Releases:</b>\r
+ * - Add hub support to match Atmel's stack\r
+ * - Add ability to get number of bytes not written with pipe/endpoint write routines after an error\r
* - Add standardized descriptor names to class driver structures\r
* - Remake AVRStudio project files\r
* - Add detailed overviews of how each demo works\r
* - Opendous-JTAG, an open source JTAG device: http://code.google.com/p/opendous-jtag/\r
* - Openkubus, an open source hardware-based authentication dongle: http://code.google.com/p/openkubus/\r
* - Orbee, a USB connected RGB Orb for notifications: http://www.franksworkshop.com.au/Electronics/Orbee/Orbee.htm\r
+ * - Programmable XBOX controller: http://richard-burke.dyndns.org/wordpress/pan-galactic-gargantuan-gargle-brain-aka-xbox-360-usb-controller/\r
* - Reprap with LUFA, a LUFA powered 3D printer: http://code.google.com/p/at90usb1287-code-for-arduino-and-eclipse/\r
* - SEGA Megadrive/Genesis Development Cartridge: http://www.makestuff.eu/wordpress/?page_id=398\r
* - SEGA Megadrive/Super Nintendo Cartridge Reader: http://www.snega2usb.com\r