1
0

Minor code cleanups for clarity.

This commit is contained in:
Dean Camera
2009-11-11 09:09:39 +00:00
parent 5de364163f
commit 04774208b6
11 changed files with 33 additions and 33 deletions

View File

@@ -28,18 +28,19 @@
this software.
*/
#define INCLUDE_FROM_SERIALSTREAM_C
#include "SerialStream.h"
FILE USARTStream = FDEV_SETUP_STREAM(SerialStream_TxByte, SerialStream_RxByte, _FDEV_SETUP_RW);
int SerialStream_TxByte(char DataByte, FILE *Stream)
static int SerialStream_TxByte(char DataByte, FILE *Stream)
{
Serial_TxByte(DataByte);
return 0;
}
int SerialStream_RxByte(FILE *Stream)
static int SerialStream_RxByte(FILE *Stream)
{
return Serial_RxByte();
}

View File

@@ -70,8 +70,10 @@
extern FILE USARTStream;
/* Function Prototypes: */
int SerialStream_TxByte(char DataByte, FILE *Stream) ATTR_NON_NULL_PTR_ARG(2);
int SerialStream_RxByte(FILE *Stream) ATTR_NON_NULL_PTR_ARG(1);
#if defined(INCLUDE_FROM_SERIALSTREAM_C)
static int SerialStream_TxByte(char DataByte, FILE *Stream) ATTR_NON_NULL_PTR_ARG(2);
static int SerialStream_RxByte(FILE *Stream) ATTR_NON_NULL_PTR_ARG(1);
#endif
#endif
/* Public Interface - May be used in end-application: */

View File

@@ -129,11 +129,11 @@ static void USB_Device_SetAddress(void)
return;
}
UDADDR = ((1 << ADDEN) | DeviceAddress);
if (DeviceAddress)
USB_DeviceState = DEVICE_STATE_Addressed;
UDADDR = ((1 << ADDEN) | DeviceAddress);
return;
}
@@ -192,10 +192,7 @@ static void USB_Device_SetConfiguration(void)
Endpoint_ClearStatusStage();
if (USB_ConfigurationNumber)
USB_DeviceState = DEVICE_STATE_Configured;
else
USB_DeviceState = DEVICE_STATE_Addressed;
USB_DeviceState = (USB_ConfigurationNumber) ? DEVICE_STATE_Configured : DEVICE_STATE_Addressed;
EVENT_USB_Device_ConfigurationChanged();
}
@@ -225,10 +222,10 @@ static void USB_Device_GetInternalSerialDescriptor(void)
int16_t UnicodeString[20];
} SignatureDescriptor;
SignatureDescriptor.Header.Size = sizeof(SignatureDescriptor);
SignatureDescriptor.Header.Type = DTYPE_String;
SignatureDescriptor.Header.Type = DTYPE_String;
SignatureDescriptor.Header.Size = sizeof(SignatureDescriptor);
uint8_t SigReadAddress = 0x0E;
uint8_t SigReadAddress = 0x0E;
for (uint8_t SerialCharNum = 0; SerialCharNum < 20; SerialCharNum++)
{
@@ -358,16 +355,16 @@ static void USB_Device_ClearSetFeature(void)
if (Endpoint_IsEnabled())
{
if (USB_ControlRequest.bRequest == REQ_ClearFeature)
if (USB_ControlRequest.bRequest == REQ_SetFeature)
{
Endpoint_StallTransaction();
}
else
{
Endpoint_ClearStall();
Endpoint_ResetFIFO(EndpointIndex);
Endpoint_ResetDataToggle();
}
else
{
Endpoint_StallTransaction();
}
}
}
}

View File

@@ -17,13 +17,13 @@
* - Added new Joystick Host ClassDriver and LowLevel demos
* - Added new Printer Host mode Class driver
* - Added new Printer Host mode ClassDriver demo
* - Added optional support for double banked endpoints in the Device mode Class drivers
* - Added new stream creation function to the CDC Class drivers, to easily make standard streams from CDC Class driver instances
* - Added optional support for double banked endpoints and pipes in the Device and Host mode Class drivers
* - Added new stream creation function to the CDC Class drivers, to easily make standard I/O streams from CDC Class driver instances
*
* <b>Changed:</b>
* - Removed mostly useless "TestApp" demo, as it was mainly useful only for checking for sytax errors in the library
* - MIDI device demos now receive MIDI events from the host and display note ON messages via the board LEDs
* - Cleanups to the Device mode Mass Storage demo applications' SCSI routines
* - Cleanups to the Device mode Mass Storage demo application SCSI routines
* - Changed Audio Class driver sample read/write functions to be inline, to reduce the number of cycles needed to transfer
* samples to and from the device (allowing more time for sample processing and output)
* - Audio class Device mode demos now work at both 16MHz and 8MHz, rather than just at 8MHz

View File

@@ -29,7 +29,7 @@
* - ATAVRUSBRF01
* - XPLAIN (AT90USB1287 only)
*
* Currently supported third-party boards:
* Currently supported third-party board (via hardware drivers):
* - BUMBLEB (using officially recommended peripheral layout)
* - Any Other Custom User Boards (with Board Drivers, \see Page_WritingBoardDrivers)
*/

View File

@@ -12,10 +12,10 @@
* or post your suggestion as an enhancement request to the project bug tracker.
*
* <b>Targeted for the Next Release (SVN Development Only):</b>
* - Add hub support to match Atmel's stack
* - Add ability to get number of bytes not written with pipe/endpoint write routines after an error
*
* <b>Targeted for Future Releases:</b>
* - Add hub support to match Atmel's stack
* - Add ability to get number of bytes not written with pipe/endpoint write routines after an error
* - Add standardized descriptor names to class driver structures
* - Remake AVRStudio project files
* - Add detailed overviews of how each demo works

View File

@@ -41,6 +41,7 @@
* - Opendous-JTAG, an open source JTAG device: http://code.google.com/p/opendous-jtag/
* - Openkubus, an open source hardware-based authentication dongle: http://code.google.com/p/openkubus/
* - Orbee, a USB connected RGB Orb for notifications: http://www.franksworkshop.com.au/Electronics/Orbee/Orbee.htm
* - Programmable XBOX controller: http://richard-burke.dyndns.org/wordpress/pan-galactic-gargantuan-gargle-brain-aka-xbox-360-usb-controller/
* - Reprap with LUFA, a LUFA powered 3D printer: http://code.google.com/p/at90usb1287-code-for-arduino-and-eclipse/
* - SEGA Megadrive/Genesis Development Cartridge: http://www.makestuff.eu/wordpress/?page_id=398
* - SEGA Megadrive/Super Nintendo Cartridge Reader: http://www.snega2usb.com