/*
LUFA Library
- Copyright (C) Dean Camera, 2010.
+ Copyright (C) Dean Camera, 2011.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
- Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
void USB_Device_ProcessControlRequest(void)
{
- uint8_t* RequestHeader = (uint8_t*)&USB_ControlRequest;
+ uint8_t* RequestHeader = (uint8_t*)&USB_ControlRequest;
for (uint8_t RequestHeaderByte = 0; RequestHeaderByte < sizeof(USB_Request_Header_t); RequestHeaderByte++)
*(RequestHeader++) = Endpoint_Read_Byte();
while (!(Endpoint_IsINReady()));
- USB_DeviceState = (DeviceAddress) ? DEVICE_STATE_Addressed : DEVICE_STATE_Default;
-
USB_Device_SetDeviceAddress(DeviceAddress);
}
+
+ USB_DeviceState = (DeviceAddress) ? DEVICE_STATE_Addressed : DEVICE_STATE_Default;
}
static void USB_Device_SetConfiguration(void)
}
#if !defined(NO_INTERNAL_SERIAL) && (USE_INTERNAL_SERIAL != NO_DESCRIPTOR)
-static char USB_Device_NibbleToASCII(uint8_t Nibble)
-{
- Nibble &= 0x0F;
- return (Nibble >= 10) ? (('A' - 10) + Nibble) : ('0' + Nibble);
-}
-
static void USB_Device_GetInternalSerialDescriptor(void)
{
struct
SigReadAddress++;
}
- SignatureDescriptor.UnicodeString[SerialCharNum] = USB_Device_NibbleToASCII(SerialByte);
+ SerialByte &= 0x0F;
+
+ SignatureDescriptor.UnicodeString[SerialCharNum] = (SerialByte >= 10) ?
+ (('A' - 10) + SerialByte) : ('0' + SerialByte);
}
}