diff options
Diffstat (limited to 'Demos')
75 files changed, 224 insertions, 197 deletions
diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.c b/Demos/Device/ClassDriver/AudioInput/AudioInput.c index 31e8d96ad..f11122fd3 100644 --- a/Demos/Device/ClassDriver/AudioInput/AudioInput.c +++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.c @@ -106,11 +106,11 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) #if defined(USE_TEST_TONE) static uint8_t SquareWaveSampleCount; static int16_t CurrentWaveValue; - + /* In test tone mode, generate a square wave at 1/256 of the sample rate */ if (SquareWaveSampleCount++ == 0xFF) CurrentWaveValue ^= 0x8000; - + /* Only generate audio if the board button is being pressed */ AudioSample = (Buttons_GetStatus() & BUTTONS_BUTTON1) ? CurrentWaveValue : 0; #else @@ -122,7 +122,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) AudioSample -= (SAMPLE_MAX_RANGE / 2); #endif #endif - + Audio_Device_WriteSample16(&Microphone_Audio_Interface, AudioSample); } @@ -211,10 +211,10 @@ bool CALLBACK_Audio_Device_GetSetEndpointProperty(USB_ClassInfo_Audio_Device_t* CurrentAudioSampleFrequency = (((uint32_t)Data[2] << 16) | ((uint32_t)Data[1] << 8) | (uint32_t)Data[0]); /* Adjust sample reload timer to the new frequency */ - OCR0A = ((F_CPU / 8 / CurrentAudioSampleFrequency) - 1); + OCR0A = ((F_CPU / 8 / CurrentAudioSampleFrequency) - 1); } - - return true; + + return true; case AUDIO_REQ_GetCurrent: /* Check if we are just testing for a valid property, or actually reading it */ if (DataLength != NULL) @@ -223,13 +223,14 @@ bool CALLBACK_Audio_Device_GetSetEndpointProperty(USB_ClassInfo_Audio_Device_t* Data[2] = (CurrentAudioSampleFrequency >> 16); Data[1] = (CurrentAudioSampleFrequency >> 8); - Data[0] = (CurrentAudioSampleFrequency & 0xFF); + Data[0] = (CurrentAudioSampleFrequency & 0xFF); } - + return true; } } } - + return false; } + diff --git a/Demos/Device/ClassDriver/AudioInput/Descriptors.c b/Demos/Device/ClassDriver/AudioInput/Descriptors.c index 2a6a77734..48059affe 100644 --- a/Demos/Device/ClassDriver/AudioInput/Descriptors.c +++ b/Demos/Device/ClassDriver/AudioInput/Descriptors.c @@ -204,7 +204,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalDiscreteSampleRates = (sizeof(ConfigurationDescriptor.Audio_AudioFormatSampleRates) / sizeof(USB_Audio_SampleFreq_t)) }, - + .Audio_AudioFormatSampleRates = { AUDIO_SAMPLE_FREQ(8000), diff --git a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c index 8858999a2..88f82006e 100644 --- a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c +++ b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c @@ -91,7 +91,7 @@ void SetupHardware(void) ISR(TIMER0_COMPA_vect, ISR_BLOCK) { uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint(); - + /* Check that the USB bus is ready for the next sample to read */ if (Audio_Device_IsSampleReceived(&Speaker_Audio_Interface)) { @@ -128,8 +128,8 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) LEDs_SetAllLEDs(LEDMask); } - - Endpoint_SelectEndpoint(PrevEndpoint); + + Endpoint_SelectEndpoint(PrevEndpoint); } /** Event handler for the library USB Connection event. */ @@ -248,10 +248,10 @@ bool CALLBACK_Audio_Device_GetSetEndpointProperty(USB_ClassInfo_Audio_Device_t* CurrentAudioSampleFrequency = (((uint32_t)Data[2] << 16) | ((uint32_t)Data[1] << 8) | (uint32_t)Data[0]); /* Adjust sample reload timer to the new frequency */ - OCR0A = ((F_CPU / 8 / CurrentAudioSampleFrequency) - 1); + OCR0A = ((F_CPU / 8 / CurrentAudioSampleFrequency) - 1); } - - return true; + + return true; case AUDIO_REQ_GetCurrent: /* Check if we are just testing for a valid property, or actually reading it */ if (DataLength != NULL) @@ -260,13 +260,14 @@ bool CALLBACK_Audio_Device_GetSetEndpointProperty(USB_ClassInfo_Audio_Device_t* Data[2] = (CurrentAudioSampleFrequency >> 16); Data[1] = (CurrentAudioSampleFrequency >> 8); - Data[0] = (CurrentAudioSampleFrequency & 0xFF); + Data[0] = (CurrentAudioSampleFrequency & 0xFF); } - + return true; } } } - + return false; } + diff --git a/Demos/Device/ClassDriver/AudioOutput/Descriptors.c b/Demos/Device/ClassDriver/AudioOutput/Descriptors.c index 75a13bb7a..50d0bb6a0 100644 --- a/Demos/Device/ClassDriver/AudioOutput/Descriptors.c +++ b/Demos/Device/ClassDriver/AudioOutput/Descriptors.c @@ -204,7 +204,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalDiscreteSampleRates = (sizeof(ConfigurationDescriptor.Audio_AudioFormatSampleRates) / sizeof(USB_Audio_SampleFreq_t)), }, - + .Audio_AudioFormatSampleRates = { AUDIO_SAMPLE_FREQ(8000), diff --git a/Demos/Device/ClassDriver/AudioOutput/Descriptors.h b/Demos/Device/ClassDriver/AudioOutput/Descriptors.h index da95077c4..aa551b00c 100644 --- a/Demos/Device/ClassDriver/AudioOutput/Descriptors.h +++ b/Demos/Device/ClassDriver/AudioOutput/Descriptors.h @@ -83,3 +83,4 @@ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); #endif + diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h index 4affeafe1..fc13b576c 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h +++ b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h @@ -109,3 +109,4 @@ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); #endif + diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.c b/Demos/Device/ClassDriver/GenericHID/GenericHID.c index 466efaf7f..be795409a 100644 --- a/Demos/Device/ClassDriver/GenericHID/GenericHID.c +++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.c @@ -145,7 +145,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn { uint8_t* Data = (uint8_t*)ReportData; uint8_t CurrLEDMask = LEDs_GetLEDs(); - + Data[0] = ((CurrLEDMask & LEDS_LED1) ? 1 : 0); Data[1] = ((CurrLEDMask & LEDS_LED2) ? 1 : 0); Data[2] = ((CurrLEDMask & LEDS_LED3) ? 1 : 0); @@ -171,7 +171,7 @@ void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDI { uint8_t* Data = (uint8_t*)ReportData; uint8_t NewLEDMask = LEDS_NO_LEDS; - + if (Data[0]) NewLEDMask |= LEDS_LED1; @@ -183,7 +183,7 @@ void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDI if (Data[3]) NewLEDMask |= LEDS_LED1; - + LEDs_SetAllLEDs(NewLEDMask); } diff --git a/Demos/Device/ClassDriver/Joystick/Descriptors.c b/Demos/Device/ClassDriver/Joystick/Descriptors.c index cc7399288..bd1ba4c9d 100644 --- a/Demos/Device/ClassDriver/Joystick/Descriptors.c +++ b/Demos/Device/ClassDriver/Joystick/Descriptors.c @@ -42,7 +42,7 @@ * descriptor is parsed by the host and its contents used to determine what data (and in what encoding) * the device will send, and what it may be sent back from the host. Refer to the HID specification for * more details on HID report descriptors. - */ + */ const USB_Descriptor_HIDReport_Datatype_t PROGMEM JoystickReport[] = { /* Use the HID class driver's standard Joystick report. diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.c b/Demos/Device/ClassDriver/Keyboard/Keyboard.c index 2072e77fb..6109ede2b 100644 --- a/Demos/Device/ClassDriver/Keyboard/Keyboard.c +++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.c @@ -8,7 +8,7 @@ /* 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 without fee, provided that the above copyright notice appear in diff --git a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c index 03caa0771..bc015ef22 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c +++ b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c @@ -279,7 +279,7 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, Address = &ConfigurationDescriptor.HID2_MouseHID; Size = sizeof(USB_HID_Descriptor_HID_t); } - + break; case HID_DTYPE_Report: if (!(wIndex)) diff --git a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c index b6a2bd7f5..2e7339b5f 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c +++ b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c @@ -258,3 +258,4 @@ void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDI LEDs_SetAllLEDs(LEDMask); } } + diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c index de60d76d8..cac4853fc 100644 --- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c +++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c @@ -77,7 +77,7 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM HIDReport[] = HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_RELATIVE), HID_RI_END_COLLECTION(0), HID_RI_END_COLLECTION(0), - + /* Keyboard Report */ HID_RI_USAGE_PAGE(8, 0x01), /* Generic Desktop */ HID_RI_USAGE(8, 0x06), /* Keyboard */ @@ -280,7 +280,7 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, break; case HID_DTYPE_HID: Address = &ConfigurationDescriptor.HID_HIDData; - Size = sizeof(USB_HID_Descriptor_HID_t); + Size = sizeof(USB_HID_Descriptor_HID_t); break; case HID_DTYPE_Report: Address = &HIDReport; diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.h b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.h index 7d9b06680..a0d99d433 100644 --- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.h +++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.h @@ -62,7 +62,7 @@ /** Size in bytes of each of the HID reporting IN endpoint. */ #define HID_EPSIZE 8 - + /* Enums: */ /** Enum for the HID report IDs used in the device. */ enum diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c index a3c0abe6b..4b6a86d89 100644 --- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c +++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c @@ -148,7 +148,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn uint8_t ButtonStatus_LCL = Buttons_GetStatus(); if (!(ButtonStatus_LCL & BUTTONS_BUTTON1)) - { + { USB_KeyboardReport_Data_t* KeyboardReport = (USB_KeyboardReport_Data_t*)ReportData; KeyboardReport->Modifier = HID_KEYBOARD_MODIFIER_LEFTSHIFT; @@ -221,3 +221,4 @@ void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDI LEDs_SetAllLEDs(LEDMask); } + diff --git a/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.c b/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.c index 66b58a124..fb4673900 100644 --- a/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.c +++ b/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.c @@ -287,7 +287,7 @@ static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfa SCSI_ASENSE_WRITE_PROTECTED, SCSI_ASENSEQ_NO_QUALIFIER); - return false; + return false; } /* Load in the 32-bit block address (SCSI uses big-endian, so have to reverse the byte order) */ @@ -311,7 +311,7 @@ static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfa /* Adjust the given block address to the real media address based on the selected LUN */ BlockAddress += ((uint32_t)MSInterfaceInfo->State.CommandBlock.LUN * LUN_MEDIA_BLOCKS); #endif - + /* Determine if the packet is a READ (10) or WRITE (10) command, call appropriate function */ if (IsDataRead == DATA_READ) DataflashManager_ReadBlocks(MSInterfaceInfo, BlockAddress, TotalBlocks); @@ -345,3 +345,4 @@ static bool SCSI_Command_ModeSense_6(USB_ClassInfo_MS_Device_t* const MSInterfac return true; } + diff --git a/Demos/Device/ClassDriver/MassStorage/MassStorage.h b/Demos/Device/ClassDriver/MassStorage/MassStorage.h index 9d926ea92..3215333ca 100644 --- a/Demos/Device/ClassDriver/MassStorage/MassStorage.h +++ b/Demos/Device/ClassDriver/MassStorage/MassStorage.h @@ -73,7 +73,7 @@ /** Blocks in each LUN, calculated from the total capacity divided by the total number of Logical Units in the device. */ #define LUN_MEDIA_BLOCKS (VIRTUAL_MEMORY_BLOCKS / TOTAL_LUNS) - + /** Indicates if the disk is write protected or not. */ #define DISK_READ_ONLY false diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.c b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.c index 717d17286..fb4673900 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.c +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.c @@ -287,7 +287,7 @@ static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfa SCSI_ASENSE_WRITE_PROTECTED, SCSI_ASENSEQ_NO_QUALIFIER); - return false; + return false; } /* Load in the 32-bit block address (SCSI uses big-endian, so have to reverse the byte order) */ @@ -345,3 +345,4 @@ static bool SCSI_Command_ModeSense_6(USB_ClassInfo_MS_Device_t* const MSInterfac return true; } + diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h index 94cb6586a..ca78a6f04 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h @@ -81,7 +81,7 @@ /** Indicates if the disk is write protected or not. */ #define DISK_READ_ONLY false - + /* Function Prototypes: */ void SetupHardware(void); diff --git a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c index adcb2939a..b53b0242d 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c @@ -87,16 +87,16 @@ int main(void) if (RNDIS_Device_IsPacketReceived(&Ethernet_RNDIS_Interface)) { LEDs_SetAllLEDs(LEDMASK_USB_BUSY); - + RNDIS_Device_ReadPacket(&Ethernet_RNDIS_Interface, &FrameIN.FrameData, &FrameIN.FrameLength); Ethernet_ProcessPacket(&FrameIN, &FrameOUT); - + if (FrameOUT.FrameLength) { - RNDIS_Device_SendPacket(&Ethernet_RNDIS_Interface, &FrameOUT.FrameData, FrameOUT.FrameLength); + RNDIS_Device_SendPacket(&Ethernet_RNDIS_Interface, &FrameOUT.FrameData, FrameOUT.FrameLength); FrameOUT.FrameLength = 0; } - + LEDs_SetAllLEDs(LEDMASK_USB_READY); } diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/SCSI.c b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/SCSI.c index 66b58a124..fb4673900 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/SCSI.c +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/SCSI.c @@ -287,7 +287,7 @@ static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfa SCSI_ASENSE_WRITE_PROTECTED, SCSI_ASENSEQ_NO_QUALIFIER); - return false; + return false; } /* Load in the 32-bit block address (SCSI uses big-endian, so have to reverse the byte order) */ @@ -311,7 +311,7 @@ static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfa /* Adjust the given block address to the real media address based on the selected LUN */ BlockAddress += ((uint32_t)MSInterfaceInfo->State.CommandBlock.LUN * LUN_MEDIA_BLOCKS); #endif - + /* Determine if the packet is a READ (10) or WRITE (10) command, call appropriate function */ if (IsDataRead == DATA_READ) DataflashManager_ReadBlocks(MSInterfaceInfo, BlockAddress, TotalBlocks); @@ -345,3 +345,4 @@ static bool SCSI_Command_ModeSense_6(USB_ClassInfo_MS_Device_t* const MSInterfac return true; } + diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c index 975067fd4..402092319 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c @@ -59,7 +59,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface = .NotificationEndpointDoubleBank = false, }, }; - + /** LUFA Mass Storage Class driver interface configuration and state information. This structure is * passed to all Mass Storage Class driver functions, so that multiple instances of the same class * within a device can be differentiated from one another. @@ -211,3 +211,4 @@ bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* const MSI return CommandSuccess; } + diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h index 7bb11d0c3..07b7420bd 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h @@ -47,7 +47,7 @@ #include "Lib/SCSI.h" #include "Lib/DataflashManager.h" - + #include <LUFA/Version.h> #include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/Joystick.h> @@ -74,7 +74,7 @@ /** Blocks in each LUN, calculated from the total capacity divided by the total number of Logical Units in the device. */ #define LUN_MEDIA_BLOCKS (VIRTUAL_MEMORY_BLOCKS / TOTAL_LUNS) - + /** Indicates if the disk is write protected or not. */ #define DISK_READ_ONLY false diff --git a/Demos/Device/Incomplete/Sideshow/Descriptors.h b/Demos/Device/Incomplete/Sideshow/Descriptors.h index e24d37e0e..4b5b9520d 100644 --- a/Demos/Device/Incomplete/Sideshow/Descriptors.h +++ b/Demos/Device/Incomplete/Sideshow/Descriptors.h @@ -47,7 +47,7 @@ typedef struct { USB_Descriptor_Configuration_Header_t Config; - + // SideShow Interface USB_Descriptor_Interface_t SSHOW_Interface; USB_Descriptor_Endpoint_t SSHOW_DataInEndpoint; diff --git a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommon.h b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommon.h index 794b91e9e..98023ec94 100644 --- a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommon.h +++ b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommon.h @@ -102,3 +102,4 @@ void SideShow_Discard_Byte_Stream(void); #endif + diff --git a/Demos/Device/Incomplete/Sideshow/Lib/SideshowContent.h b/Demos/Device/Incomplete/Sideshow/Lib/SideshowContent.h index 452aad802..270010e0c 100644 --- a/Demos/Device/Incomplete/Sideshow/Lib/SideshowContent.h +++ b/Demos/Device/Incomplete/Sideshow/Lib/SideshowContent.h @@ -125,3 +125,4 @@ #endif #endif + diff --git a/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c b/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c index 3b8c29586..0d2c96672 100644 --- a/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c +++ b/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c @@ -1,7 +1,7 @@ /* LUFA Library Copyright (C) Dean Camera, 2011. - + dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ @@ -9,13 +9,13 @@ /* Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) - Permission to use, copy, modify, distribute, and sell this + Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in + without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaim all warranties with regard to this @@ -38,7 +38,7 @@ TMC_Capabilities_t Capabilities = { .Status = TMC_STATUS_SUCCESS, .TMCVersion = VERSION_BCD(1.00), - + .Interface = { .ListenOnly = false, @@ -82,7 +82,7 @@ int main(void) LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); sei(); - + for (;;) { TMC_Task(); @@ -99,7 +99,7 @@ void SetupHardware(void) /* Disable clock division */ clock_prescale_set(clock_div_1); - + /* Hardware Initialization */ LEDs_Init(); USB_Init(); @@ -167,43 +167,43 @@ void EVENT_USB_Device_ControlRequest(void) { /* Indicate that all in-progress/pending data OUT requests should be aborted */ IsTMCBulkOUTReset = true; - + /* Save the split request for later checking when a new request is received */ RequestInProgress = Req_InitiateAbortBulkOut; } Endpoint_ClearSETUP(); - + /* Write the request response byte */ Endpoint_Write_8(TMCRequestStatus); Endpoint_ClearIN(); Endpoint_ClearStatusStage(); } - + break; case Req_CheckAbortBulkOutStatus: if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_ENDPOINT)) { /* Check that an ABORT BULK OUT transaction has been requested and that the request has completed */ if (RequestInProgress != Req_InitiateAbortBulkOut) - TMCRequestStatus = TMC_STATUS_SPLIT_NOT_IN_PROGRESS; + TMCRequestStatus = TMC_STATUS_SPLIT_NOT_IN_PROGRESS; else if (IsTMCBulkOUTReset) TMCRequestStatus = TMC_STATUS_PENDING; else - RequestInProgress = 0; + RequestInProgress = 0; Endpoint_ClearSETUP(); - + /* Write the request response bytes */ Endpoint_Write_8(TMCRequestStatus); Endpoint_Write_16_LE(0); Endpoint_Write_32_LE(LastTransferLength); Endpoint_ClearIN(); - Endpoint_ClearStatusStage(); + Endpoint_ClearStatusStage(); } - + break; case Req_InitiateAbortBulkIn: if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_ENDPOINT)) @@ -211,7 +211,7 @@ void EVENT_USB_Device_ControlRequest(void) /* Check that no split transaction is already in progress and the data transfer tag is valid */ if (RequestInProgress != 0) { - TMCRequestStatus = TMC_STATUS_SPLIT_IN_PROGRESS; + TMCRequestStatus = TMC_STATUS_SPLIT_IN_PROGRESS; } else if (USB_ControlRequest.wValue != CurrentTransferTag) { @@ -221,13 +221,13 @@ void EVENT_USB_Device_ControlRequest(void) { /* Indicate that all in-progress/pending data IN requests should be aborted */ IsTMCBulkINReset = true; - + /* Save the split request for later checking when a new request is received */ RequestInProgress = Req_InitiateAbortBulkIn; } Endpoint_ClearSETUP(); - + /* Write the request response bytes */ Endpoint_Write_8(TMCRequestStatus); Endpoint_Write_8(CurrentTransferTag); @@ -235,7 +235,7 @@ void EVENT_USB_Device_ControlRequest(void) Endpoint_ClearIN(); Endpoint_ClearStatusStage(); } - + break; case Req_CheckAbortBulkInStatus: if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_ENDPOINT)) @@ -249,7 +249,7 @@ void EVENT_USB_Device_ControlRequest(void) RequestInProgress = 0; Endpoint_ClearSETUP(); - + /* Write the request response bytes */ Endpoint_Write_8(TMCRequestStatus); Endpoint_Write_16_LE(0); @@ -258,7 +258,7 @@ void EVENT_USB_Device_ControlRequest(void) Endpoint_ClearIN(); Endpoint_ClearStatusStage(); } - + break; case Req_InitiateClear: if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) @@ -266,34 +266,34 @@ void EVENT_USB_Device_ControlRequest(void) /* Check that no split transaction is already in progress */ if (RequestInProgress != 0) { - Endpoint_Write_8(TMC_STATUS_SPLIT_IN_PROGRESS); + Endpoint_Write_8(TMC_STATUS_SPLIT_IN_PROGRESS); } else { /* Indicate that all in-progress/pending data IN and OUT requests should be aborted */ IsTMCBulkINReset = true; IsTMCBulkOUTReset = true; - + /* Save the split request for later checking when a new request is received */ RequestInProgress = Req_InitiateClear; } Endpoint_ClearSETUP(); - + /* Write the request response byte */ Endpoint_Write_8(TMCRequestStatus); Endpoint_ClearIN(); Endpoint_ClearStatusStage(); } - + break; case Req_CheckClearStatus: if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) { /* Check that a CLEAR transaction has been requested and that the request has completed */ if (RequestInProgress != Req_InitiateClear) - TMCRequestStatus = TMC_STATUS_SPLIT_NOT_IN_PROGRESS; + TMCRequestStatus = TMC_STATUS_SPLIT_NOT_IN_PROGRESS; else if (IsTMCBulkINReset || IsTMCBulkOUTReset) TMCRequestStatus = TMC_STATUS_PENDING; else @@ -304,22 +304,22 @@ void EVENT_USB_Device_ControlRequest(void) /* Write the request response bytes */ Endpoint_Write_8(TMCRequestStatus); Endpoint_Write_8(0); - + Endpoint_ClearIN(); - Endpoint_ClearStatusStage(); + Endpoint_ClearStatusStage(); } - + break; case Req_GetCapabilities: if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) { Endpoint_ClearSETUP(); - + /* Write the device capabilities to the control endpoint */ - Endpoint_Write_Control_Stream_LE(&Capabilities, sizeof(TMC_Capabilities_t)); + Endpoint_Write_Control_Stream_LE(&Capabilities, sizeof(TMC_Capabilities_t)); Endpoint_ClearOUT(); } - + break; } } @@ -351,16 +351,16 @@ void TMC_Task(void) /* Device must be connected and configured for the task to run */ if (USB_DeviceState != DEVICE_STATE_Configured) return; - + TMC_MessageHeader_t MessageHeader; uint8_t MessagePayload[128]; - + /* Try to read in a TMC message from the interface, process if one is available */ if (ReadTMCHeader(&MessageHeader)) { /* Indicate busy */ LEDs_SetAllLEDs(LEDMASK_USB_BUSY); - + switch (MessageHeader.MessageID) { case TMC_MESSAGEID_DEV_DEP_MSG_OUT: @@ -371,15 +371,15 @@ void TMC_Task(void) if (IsTMCBulkOUTReset) break; } - + Endpoint_ClearOUT(); - ProcessSentMessage(MessagePayload, LastTransferLength); + ProcessSentMessage(MessagePayload, LastTransferLength); break; case TMC_MESSAGEID_DEV_DEP_MSG_IN: Endpoint_ClearOUT(); - - MessageHeader.TransferSize = GetNextMessage(MessagePayload); + + MessageHeader.TransferSize = GetNextMessage(MessagePayload); MessageHeader.MessageIDSpecific.DeviceOUT.LastMessageTransaction = true; WriteTMCHeader(&MessageHeader); @@ -400,7 +400,7 @@ void TMC_Task(void) LEDs_SetAllLEDs(LEDMASK_USB_READY); } - + /* All pending data has been processed - reset the data abort flags */ IsTMCBulkINReset = false; IsTMCBulkOUTReset = false; @@ -419,11 +419,11 @@ bool ReadTMCHeader(TMC_MessageHeader_t* const MessageHeader) /* Select the Data Out endpoint */ Endpoint_SelectEndpoint(TMC_OUT_EPNUM); - + /* Abort if no command has been sent from the host */ if (!(Endpoint_IsOUTReceived())) return false; - + /* Read in the header of the command from the host */ BytesTransferred = 0; while ((ErrorCode = Endpoint_Read_Stream_LE(MessageHeader, sizeof(TMC_MessageHeader_t), &BytesTransferred)) == @@ -435,7 +435,7 @@ bool ReadTMCHeader(TMC_MessageHeader_t* const MessageHeader) /* Store the new command tag value for later use */ CurrentTransferTag = MessageHeader->Tag; - + /* Indicate if the command has been aborted or not */ return (!(IsTMCBulkOUTReset) && (ErrorCode == ENDPOINT_RWSTREAM_NoError)); } @@ -464,3 +464,4 @@ bool WriteTMCHeader(TMC_MessageHeader_t* const MessageHeader) /* Indicate if the command has been aborted or not */ return (!(IsTMCBulkINReset) && (ErrorCode == ENDPOINT_RWSTREAM_NoError)); } + diff --git a/Demos/Device/LowLevel/AudioInput/AudioInput.c b/Demos/Device/LowLevel/AudioInput/AudioInput.c index 52fbb8bd6..ff165b25c 100644 --- a/Demos/Device/LowLevel/AudioInput/AudioInput.c +++ b/Demos/Device/LowLevel/AudioInput/AudioInput.c @@ -163,16 +163,16 @@ void EVENT_USB_Device_ControlRequest(void) /* Extract out the relevant request information to get the target Endpoint address and control being set */ uint8_t EndpointAddress = (uint8_t)USB_ControlRequest.wIndex; uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8); - + /* Only handle SET CURRENT requests to the audio endpoint's sample frequency property */ if ((EndpointAddress == (ENDPOINT_DIR_IN | AUDIO_STREAM_EPNUM)) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)) { uint8_t SampleRate[3]; - + Endpoint_ClearSETUP(); Endpoint_Read_Control_Stream_LE(SampleRate, sizeof(SampleRate)); Endpoint_ClearIN(); - + /* Set the new sampling frequency to the value given by the host */ CurrentAudioSampleFrequency = (((uint32_t)SampleRate[2] << 16) | ((uint32_t)SampleRate[1] << 8) | (uint32_t)SampleRate[0]); @@ -180,7 +180,7 @@ void EVENT_USB_Device_ControlRequest(void) OCR0A = ((F_CPU / 8 / CurrentAudioSampleFrequency) - 1); } } - + break; case AUDIO_REQ_GetCurrent: if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_ENDPOINT)) @@ -188,20 +188,20 @@ void EVENT_USB_Device_ControlRequest(void) /* Extract out the relevant request information to get the target Endpoint address and control being retrieved */ uint8_t EndpointAddress = (uint8_t)USB_ControlRequest.wIndex; uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8); - + /* Only handle GET CURRENT requests to the audio endpoint's sample frequency property */ if ((EndpointAddress == (ENDPOINT_DIR_IN | AUDIO_STREAM_EPNUM)) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)) { uint8_t SampleRate[3]; - + /* Convert the sampling rate value into the 24-bit format the host expects for the property */ SampleRate[2] = (CurrentAudioSampleFrequency >> 16); SampleRate[1] = (CurrentAudioSampleFrequency >> 8); SampleRate[0] = (CurrentAudioSampleFrequency & 0xFF); - + Endpoint_ClearSETUP(); Endpoint_Write_Control_Stream_LE(SampleRate, sizeof(SampleRate)); - Endpoint_ClearOUT(); + Endpoint_ClearOUT(); } } @@ -225,11 +225,11 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) #if defined(USE_TEST_TONE) static uint8_t SquareWaveSampleCount; static int16_t CurrentWaveValue; - + /* In test tone mode, generate a square wave at 1/256 of the sample rate */ if (SquareWaveSampleCount++ == 0xFF) CurrentWaveValue ^= 0x8000; - + /* Only generate audio if the board button is being pressed */ AudioSample = (Buttons_GetStatus() & BUTTONS_BUTTON1) ? CurrentWaveValue : 0; #else @@ -239,7 +239,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) #if defined(MICROPHONE_BIASED_TO_HALF_RAIL) /* Microphone is biased to half rail voltage, subtract the bias from the sample value */ AudioSample -= (SAMPLE_MAX_RANGE / 2); - #endif + #endif #endif /* Write the sample to the buffer */ diff --git a/Demos/Device/LowLevel/AudioInput/Descriptors.c b/Demos/Device/LowLevel/AudioInput/Descriptors.c index ee9feb39d..b41e60468 100644 --- a/Demos/Device/LowLevel/AudioInput/Descriptors.c +++ b/Demos/Device/LowLevel/AudioInput/Descriptors.c @@ -204,7 +204,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalDiscreteSampleRates = (sizeof(ConfigurationDescriptor.Audio_AudioFormatSampleRates) / sizeof(USB_Audio_SampleFreq_t)), }, - + .Audio_AudioFormatSampleRates = { AUDIO_SAMPLE_FREQ(8000), diff --git a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c index 47f3ccb27..f079dca0f 100644 --- a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c +++ b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c @@ -189,16 +189,16 @@ void EVENT_USB_Device_ControlRequest(void) /* Extract out the relevant request information to get the target Endpoint address and control being set */ uint8_t EndpointAddress = (uint8_t)USB_ControlRequest.wIndex; uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8); - + /* Only handle SET CURRENT requests to the audio endpoint's sample frequency property */ if ((EndpointAddress == (ENDPOINT_DIR_OUT | AUDIO_STREAM_EPNUM)) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)) { uint8_t SampleRate[3]; - + Endpoint_ClearSETUP(); Endpoint_Read_Control_Stream_LE(SampleRate, sizeof(SampleRate)); Endpoint_ClearOUT(); - + /* Set the new sampling frequency to the value given by the host */ CurrentAudioSampleFrequency = (((uint32_t)SampleRate[2] << 16) | ((uint32_t)SampleRate[1] << 8) | (uint32_t)SampleRate[0]); @@ -206,7 +206,7 @@ void EVENT_USB_Device_ControlRequest(void) OCR0A = ((F_CPU / 8 / CurrentAudioSampleFrequency) - 1); } } - + break; case AUDIO_REQ_GetCurrent: if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_ENDPOINT)) @@ -214,20 +214,20 @@ void EVENT_USB_Device_ControlRequest(void) /* Extract out the relevant request information to get the target Endpoint address and control being retrieved */ uint8_t EndpointAddress = (uint8_t)USB_ControlRequest.wIndex; uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8); - + /* Only handle GET CURRENT requests to the audio endpoint's sample frequency property */ if ((EndpointAddress == (ENDPOINT_DIR_OUT | AUDIO_STREAM_EPNUM)) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)) { uint8_t SampleRate[3]; - + /* Convert the sampling rate value into the 24-bit format the host expects for the property */ SampleRate[2] = (CurrentAudioSampleFrequency >> 16); SampleRate[1] = (CurrentAudioSampleFrequency >> 8); SampleRate[0] = (CurrentAudioSampleFrequency & 0xFF); - + Endpoint_ClearSETUP(); Endpoint_Write_Control_Stream_LE(SampleRate, sizeof(SampleRate)); - Endpoint_ClearOUT(); + Endpoint_ClearOUT(); } } @@ -286,7 +286,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) LEDs_SetAllLEDs(LEDMask); } - + Endpoint_SelectEndpoint(PrevEndpoint); } diff --git a/Demos/Device/LowLevel/AudioOutput/Descriptors.c b/Demos/Device/LowLevel/AudioOutput/Descriptors.c index 0fa396daf..771ec17a7 100644 --- a/Demos/Device/LowLevel/AudioOutput/Descriptors.c +++ b/Demos/Device/LowLevel/AudioOutput/Descriptors.c @@ -204,7 +204,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalDiscreteSampleRates = (sizeof(ConfigurationDescriptor.Audio_AudioFormatSampleRates) / sizeof(USB_Audio_SampleFreq_t)), }, - + .Audio_AudioFormatSampleRates = { AUDIO_SAMPLE_FREQ(8000), diff --git a/Demos/Device/LowLevel/AudioOutput/Descriptors.h b/Demos/Device/LowLevel/AudioOutput/Descriptors.h index da95077c4..aa551b00c 100644 --- a/Demos/Device/LowLevel/AudioOutput/Descriptors.h +++ b/Demos/Device/LowLevel/AudioOutput/Descriptors.h @@ -83,3 +83,4 @@ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); #endif + diff --git a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h index a007baab6..2fe3b89f6 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h +++ b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h @@ -109,3 +109,4 @@ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); #endif + diff --git a/Demos/Device/LowLevel/GenericHID/GenericHID.c b/Demos/Device/LowLevel/GenericHID/GenericHID.c index 69c417655..a3d2e69eb 100644 --- a/Demos/Device/LowLevel/GenericHID/GenericHID.c +++ b/Demos/Device/LowLevel/GenericHID/GenericHID.c @@ -157,7 +157,7 @@ void ProcessGenericHIDReport(uint8_t* DataArray) holding the report sent from the host. */ - uint8_t NewLEDMask = LEDS_NO_LEDS; + uint8_t NewLEDMask = LEDS_NO_LEDS; if (DataArray[0]) NewLEDMask |= LEDS_LED1; @@ -170,7 +170,7 @@ void ProcessGenericHIDReport(uint8_t* DataArray) if (DataArray[3]) NewLEDMask |= LEDS_LED1; - + LEDs_SetAllLEDs(NewLEDMask); } @@ -187,7 +187,7 @@ void CreateGenericHIDReport(uint8_t* DataArray) */ uint8_t CurrLEDMask = LEDs_GetLEDs(); - + DataArray[0] = ((CurrLEDMask & LEDS_LED1) ? 1 : 0); DataArray[1] = ((CurrLEDMask & LEDS_LED2) ? 1 : 0); DataArray[2] = ((CurrLEDMask & LEDS_LED3) ? 1 : 0); diff --git a/Demos/Device/LowLevel/MassStorage/Descriptors.h b/Demos/Device/LowLevel/MassStorage/Descriptors.h index 043d65994..b65938ea7 100644 --- a/Demos/Device/LowLevel/MassStorage/Descriptors.h +++ b/Demos/Device/LowLevel/MassStorage/Descriptors.h @@ -59,7 +59,7 @@ typedef struct { USB_Descriptor_Configuration_Header_t Config; - + // Mass Storage Interface USB_Descriptor_Interface_t MS_Interface; USB_Descriptor_Endpoint_t MS_DataInEndpoint; diff --git a/Demos/Device/LowLevel/MassStorage/Lib/SCSI.c b/Demos/Device/LowLevel/MassStorage/Lib/SCSI.c index 432678612..0fd62c031 100644 --- a/Demos/Device/LowLevel/MassStorage/Lib/SCSI.c +++ b/Demos/Device/LowLevel/MassStorage/Lib/SCSI.c @@ -287,12 +287,12 @@ static bool SCSI_Command_ReadWrite_10(const bool IsDataRead) SCSI_ASENSE_WRITE_PROTECTED, SCSI_ASENSEQ_NO_QUALIFIER); - return false; + return false; } BlockAddress = SwapEndian_32(*(uint32_t*)&CommandBlock.SCSICommandData[2]); TotalBlocks = SwapEndian_16(*(uint16_t*)&CommandBlock.SCSICommandData[7]); - + /* Check if the block address is outside the maximum allowable value for the LUN */ if (BlockAddress >= LUN_MEDIA_BLOCKS) { @@ -340,3 +340,4 @@ static bool SCSI_Command_ModeSense_6(void) return true; } + diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.c b/Demos/Device/LowLevel/MassStorage/MassStorage.c index 7f2d86610..abac8b71e 100644 --- a/Demos/Device/LowLevel/MassStorage/MassStorage.c +++ b/Demos/Device/LowLevel/MassStorage/MassStorage.c @@ -309,7 +309,8 @@ static void ReturnCommandStatus(void) if (IsMassStoreReset) return; } - + /* Finalize the stream transfer to send the last packet */ Endpoint_ClearIN(); } + diff --git a/Demos/Device/LowLevel/Mouse/Descriptors.h b/Demos/Device/LowLevel/Mouse/Descriptors.h index f88f530b2..60fd74084 100644 --- a/Demos/Device/LowLevel/Mouse/Descriptors.h +++ b/Demos/Device/LowLevel/Mouse/Descriptors.h @@ -49,7 +49,7 @@ typedef struct { USB_Descriptor_Configuration_Header_t Config; - + // Mouse HID Interface USB_Descriptor_Interface_t HID_Interface; USB_HID_Descriptor_HID_t HID_MouseHID; diff --git a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c index 9ad26dd2f..d0df97309 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c +++ b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c @@ -73,9 +73,9 @@ void SetupHardware(void) LEDs_Init(); Serial_Init(9600, false); USB_Init(); - + /* Create a stdio stream for the serial port for stdin and stdout */ - Serial_CreateStream(NULL); + Serial_CreateStream(NULL); } /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.h b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.h index f88f530b2..60fd74084 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.h +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.h @@ -49,7 +49,7 @@ typedef struct { USB_Descriptor_Configuration_Header_t Config; - + // Mouse HID Interface USB_Descriptor_Interface_t HID_Interface; USB_HID_Descriptor_HID_t HID_MouseHID; diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c b/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c index 246ff3571..73e163e4e 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c @@ -74,7 +74,7 @@ void EVENT_USB_Host_DeviceUnattached(void) * enumerated by the host and is now ready to be used by the application. */ void EVENT_USB_Host_DeviceEnumerationComplete(void) -{ +{ LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING); uint16_t ConfigDescriptorSize; diff --git a/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.c b/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.c index 2c9cd805a..85819aeea 100644 --- a/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.c +++ b/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.c @@ -225,3 +225,4 @@ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
+ diff --git a/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.h b/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.h index a36010ea8..693f92514 100644 --- a/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.h +++ b/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.h @@ -76,3 +76,4 @@ #endif
+ diff --git a/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.c b/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.c index f789f6318..a8a51b8f1 100644 --- a/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.c +++ b/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.c @@ -96,7 +96,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) LEDs_SetAllLEDs(LEDMask); } - + Pipe_SelectPipe(PrevPipe); } @@ -193,7 +193,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) TIMSK0 = (1 << OCIE0A); OCR0A = ((F_CPU / 8 / 48000) - 1); TCCR0A = (1 << WGM01); // CTC mode - TCCR0B = (1 << CS01); // Fcpu/8 speed + TCCR0B = (1 << CS01); // Fcpu/8 speed /* Set speaker as output */ DDRC |= (1 << 6); diff --git a/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c b/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c index c8dc3a35d..9696673c3 100644 --- a/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c +++ b/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c @@ -81,11 +81,11 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) #if defined(USE_TEST_TONE) static uint8_t SquareWaveSampleCount; static int16_t CurrentWaveValue; - + /* In test tone mode, generate a square wave at 1/256 of the sample rate */ if (SquareWaveSampleCount++ == 0xFF) CurrentWaveValue ^= 0x8000; - + /* Only generate audio if the board button is being pressed */ AudioSample = (Buttons_GetStatus() & BUTTONS_BUTTON1) ? CurrentWaveValue : 0; #else @@ -97,11 +97,11 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) AudioSample -= (SAMPLE_MAX_RANGE / 2); #endif #endif - - Audio_Host_WriteSample16(&Speaker_Audio_Interface, AudioSample); + + Audio_Host_WriteSample16(&Speaker_Audio_Interface, AudioSample); Audio_Host_WriteSample16(&Speaker_Audio_Interface, AudioSample); } - + Pipe_SelectPipe(PrevPipe); } @@ -185,7 +185,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) USB_Host_SetDeviceConfiguration(0); return; } - + USB_Audio_SampleFreq_t SampleRate = AUDIO_SAMPLE_FREQ(48000); if (Audio_Host_GetSetEndpointProperty(&Speaker_Audio_Interface, Speaker_Audio_Interface.Config.DataOUTPipeNumber, AUDIO_REQ_SetCurrent, AUDIO_EPCONTROL_SamplingFreq, diff --git a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c index 81c877afa..f2050e896 100644 --- a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c +++ b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c @@ -140,7 +140,7 @@ void KeyboardHost_Task(void) { PressedKey = '\n'; } - + if (PressedKey) putchar(PressedKey); } diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c index 3bf5dd254..9c2ec07dd 100644 --- a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c +++ b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c @@ -107,7 +107,7 @@ void KeyboardHost_Task(void) { if (USB_HostState != HOST_STATE_Configured) return; - + if (HID_Host_IsReportReceived(&Keyboard_HID_Interface)) { uint8_t KeyboardReport[Keyboard_HID_Interface.State.LargestReportSize]; diff --git a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c index 5fc3fdfdb..2c216441c 100644 --- a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c +++ b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c @@ -68,7 +68,7 @@ int main(void) for (;;) { MassStorageHost_Task(); - + MS_Host_USBTask(&FlashDisk_MS_Interface); USB_USBTask(); } diff --git a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h index b4aa02ac9..b254edc7b 100644 --- a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h +++ b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h @@ -70,7 +70,7 @@ /* Function Prototypes: */ void SetupHardware(void); void MassStorageHost_Task(void); - + void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); diff --git a/Demos/Host/ClassDriver/MouseHost/MouseHost.c b/Demos/Host/ClassDriver/MouseHost/MouseHost.c index ebdc4e28c..6785af725 100644 --- a/Demos/Host/ClassDriver/MouseHost/MouseHost.c +++ b/Demos/Host/ClassDriver/MouseHost/MouseHost.c @@ -102,7 +102,7 @@ void MouseHost_Task(void) { if (USB_HostState != HOST_STATE_Configured) return; - + if (HID_Host_IsReportReceived(&Mouse_HID_Interface)) { uint8_t LEDMask = LEDS_NO_LEDS; diff --git a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c index d8a6b74e6..46105f38e 100644 --- a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c +++ b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c @@ -107,7 +107,7 @@ void MouseHost_Task(void) { if (USB_HostState != HOST_STATE_Configured) return; - + if (HID_Host_IsReportReceived(&Mouse_HID_Interface)) { uint8_t MouseReport[Mouse_HID_Interface.State.LargestReportSize]; diff --git a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c index 6dd734401..dea4694ea 100644 --- a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c +++ b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c @@ -71,7 +71,7 @@ int main(void) for (;;) { StillImageHost_Task(); - + SI_Host_USBTask(&DigitalCamera_SI_Interface); USB_USBTask(); } diff --git a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c index 72d7e5834..2ceb95009 100644 --- a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c +++ b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c @@ -62,7 +62,7 @@ USB_ClassInfo_CDC_Host_t VirtualSerial_CDC_Interface = int main(void) { SetupHardware(); - + puts_P(PSTR(ESC_FG_CYAN "CDC Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); diff --git a/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.c b/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.c index 7b2b79604..4ed013339 100644 --- a/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.c +++ b/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.c @@ -78,7 +78,7 @@ void SetupHardware(void) void AndroidHost_Task(void) { if (USB_HostState != HOST_STATE_Configured) - return; + return; /* Select the data IN pipe */ Pipe_SelectPipe(ANDROID_DATA_IN_PIPE); @@ -148,7 +148,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) /* Get and process the configuration descriptor data */ uint8_t ErrorCode = ProcessDeviceDescriptor(); - + bool RequiresModeSwitch = (ErrorCode == NonAccessoryModeAndroidDevice); /* Error out if the device is not an Android device or an error occurred */ @@ -166,12 +166,12 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) } printf_P(PSTR("Android Device Detected - %sAccessory mode.\r\n"), (RequiresModeSwitch ? "Non-" : "")); - + /* Check if a valid Android device was attached, but it is not current in Accessory mode */ if (RequiresModeSwitch) { uint16_t AndroidProtocol; - + /* Fetch the version of the Android Accessory Protocol supported by the device */ if ((ErrorCode = Android_GetAccessoryProtocol(&AndroidProtocol)) != HOST_SENDCONTROL_Successful) { @@ -181,7 +181,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) LEDs_SetAllLEDs(LEDMASK_USB_ERROR); return; } - + /* Validate the returned protocol version */ if (AndroidProtocol != AOA_PROTOCOL_AccessoryV1) { @@ -190,7 +190,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) LEDs_SetAllLEDs(LEDMASK_USB_ERROR); return; } - + /* Send the device strings and start the Android Accessory Mode */ Android_SendString(AOA_STRING_Manufacturer, "Dean Camera"); Android_SendString(AOA_STRING_Model, "LUFA Android Demo"); @@ -199,7 +199,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) Android_SendString(AOA_STRING_URI, "http://www.lufa-lib.org"); Android_SendString(AOA_STRING_Serial, "0000000012345678"); - Android_StartAccessoryMode(); + Android_StartAccessoryMode(); return; } diff --git a/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.h b/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.h index 6c8702fc5..714e2dafc 100644 --- a/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.h +++ b/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.h @@ -46,7 +46,7 @@ #include "DeviceDescriptor.h" #include "ConfigDescriptor.h" - #include "Lib/AndroidAccessoryCommands.h" + #include "Lib/AndroidAccessoryCommands.h" #include <LUFA/Version.h> #include <LUFA/Drivers/Misc/TerminalCodes.h> diff --git a/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.c b/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.c index 973ac537c..487d51898 100644 --- a/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.c @@ -66,7 +66,7 @@ uint8_t ProcessConfigurationDescriptor(void) default: return DevControlError; } - + /* There should be only one compatible Android Accessory Mode interface in the device, attempt to find it */ if (USB_GetNextDescriptorComp(&CurrConfigBytesRem, &CurrConfigLocation, DCOMP_NextAndroidAccessoryInterface) != DESCRIPTOR_SEARCH_COMP_Found) diff --git a/Demos/Host/LowLevel/AndroidAccessoryHost/Lib/AndroidAccessoryCommands.c b/Demos/Host/LowLevel/AndroidAccessoryHost/Lib/AndroidAccessoryCommands.c index 42c3a62fa..7e1e7c806 100644 --- a/Demos/Host/LowLevel/AndroidAccessoryHost/Lib/AndroidAccessoryCommands.c +++ b/Demos/Host/LowLevel/AndroidAccessoryHost/Lib/AndroidAccessoryCommands.c @@ -33,8 +33,8 @@ * Android Accessory Mode utility functions, for the configuration of an attached * Android device into Android Accessory Mode ready for general communication. */ - -#include "AndroidAccessoryCommands.h" + +#include "AndroidAccessoryCommands.h" uint8_t Android_GetAccessoryProtocol(uint16_t* const Protocol) { @@ -79,5 +79,6 @@ uint8_t Android_StartAccessoryMode(void) }; Pipe_SelectPipe(PIPE_CONTROLPIPE); - return USB_Host_SendControlRequest(NULL); + return USB_Host_SendControlRequest(NULL); } + diff --git a/Demos/Host/LowLevel/AndroidAccessoryHost/Lib/AndroidAccessoryCommands.h b/Demos/Host/LowLevel/AndroidAccessoryHost/Lib/AndroidAccessoryCommands.h index 0fab7635f..00326aba2 100644 --- a/Demos/Host/LowLevel/AndroidAccessoryHost/Lib/AndroidAccessoryCommands.h +++ b/Demos/Host/LowLevel/AndroidAccessoryHost/Lib/AndroidAccessoryCommands.h @@ -41,11 +41,12 @@ #include <stdbool.h> #include <LUFA/Drivers/USB/USB.h> - + /* Function Prototypes: */ uint8_t Android_GetAccessoryProtocol(uint16_t* const Protocol); uint8_t Android_SendString(const uint8_t StringIndex, const char* const String); - uint8_t Android_StartAccessoryMode(void); - + uint8_t Android_StartAccessoryMode(void); + #endif + diff --git a/Demos/Host/LowLevel/AudioInputHost/AudioInputHost.c b/Demos/Host/LowLevel/AudioInputHost/AudioInputHost.c index 97a18a0f7..1bdbd282b 100644 --- a/Demos/Host/LowLevel/AudioInputHost/AudioInputHost.c +++ b/Demos/Host/LowLevel/AudioInputHost/AudioInputHost.c @@ -123,7 +123,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) LEDs_SetAllLEDs(LEDMASK_USB_ERROR); return; } - + if ((ErrorCode = USB_Host_SetInterfaceAltSetting(StreamingInterfaceIndex, StreamingInterfaceAltSetting)) != HOST_SENDCONTROL_Successful) { @@ -143,7 +143,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) .wIndex = StreamingEndpointAddress, .wLength = sizeof(USB_Audio_SampleFreq_t), }; - + USB_Audio_SampleFreq_t SampleRate = AUDIO_SAMPLE_FREQ(48000); /* Select the control pipe for the request transfer */ @@ -153,7 +153,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) if ((ErrorCode = USB_Host_SendControlRequest(&SampleRate)) != HOST_SENDCONTROL_Successful) { LEDs_SetAllLEDs(LEDMASK_USB_ERROR); - USB_Host_SetDeviceConfiguration(0); + USB_Host_SetDeviceConfiguration(0); return; } @@ -161,7 +161,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) TIMSK0 = (1 << OCIE0A); OCR0A = ((F_CPU / 8 / 48000) - 1); TCCR0A = (1 << WGM01); // CTC mode - TCCR0B = (1 << CS01); // Fcpu/8 speed + TCCR0B = (1 << CS01); // Fcpu/8 speed /* Set speaker as output */ DDRC |= (1 << 6); @@ -169,7 +169,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) /* PWM speaker timer initialization */ TCCR3A = ((1 << WGM30) | (1 << COM3A1) | (1 << COM3A0)); // Set on match, clear on TOP TCCR3B = ((1 << WGM32) | (1 << CS30)); // Fast 8-Bit PWM, F_CPU speed - + puts_P(PSTR("Microphone Enumerated.\r\n")); LEDs_SetAllLEDs(LEDMASK_USB_READY); } @@ -238,7 +238,8 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) LEDs_SetAllLEDs(LEDMask); } - + Pipe_Freeze(); Pipe_SelectPipe(PrevPipe); } + diff --git a/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.c b/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.c index 943fa029b..89069a8fe 100644 --- a/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.c @@ -99,7 +99,7 @@ uint8_t ProcessConfigurationDescriptor(void) } /* Save the interface in case we need to refer back to it later */ - AudioControlInterface = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_Interface_t); + AudioControlInterface = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_Interface_t); /* Find the next Audio Streaming interface within that Audio Control interface */ if (USB_GetNextDescriptorComp(&CurrConfigBytesRem, &CurrConfigLocation, @@ -218,3 +218,4 @@ uint8_t DComp_NextAudioInterfaceDataEndpoint(void* CurrentDescriptor) return DESCRIPTOR_SEARCH_NotFound; } + diff --git a/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.c b/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.c index 704ddea98..c77d7fd70 100644 --- a/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.c +++ b/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.c @@ -68,7 +68,7 @@ void SetupHardware(void) Serial_Init(9600, false); Buttons_Init(); ADC_Init(ADC_FREE_RUNNING | ADC_PRESCALE_32); - ADC_SetupChannel(MIC_IN_ADC_CHANNEL); + ADC_SetupChannel(MIC_IN_ADC_CHANNEL); LEDs_Init(); USB_Init(); @@ -126,7 +126,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) LEDs_SetAllLEDs(LEDMASK_USB_ERROR); return; } - + if ((ErrorCode = USB_Host_SetInterfaceAltSetting(StreamingInterfaceIndex, StreamingInterfaceAltSetting)) != HOST_SENDCONTROL_Successful) { @@ -146,7 +146,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) .wIndex = StreamingEndpointAddress, .wLength = sizeof(USB_Audio_SampleFreq_t), }; - + USB_Audio_SampleFreq_t SampleRate = AUDIO_SAMPLE_FREQ(48000); /* Select the control pipe for the request transfer */ @@ -164,8 +164,8 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) TIMSK0 = (1 << OCIE0A); OCR0A = ((F_CPU / 8 / 48000) - 1); TCCR0A = (1 << WGM01); // CTC mode - TCCR0B = (1 << CS01); // Fcpu/8 speed - + TCCR0B = (1 << CS01); // Fcpu/8 speed + puts_P(PSTR("Speaker Enumerated.\r\n")); LEDs_SetAllLEDs(LEDMASK_USB_READY); } @@ -207,16 +207,16 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) /* Check if the current pipe can be written to (device ready for more data) */ if (Pipe_IsOUTReady()) { - int16_t AudioSample; - + int16_t AudioSample; + #if defined(USE_TEST_TONE) static uint8_t SquareWaveSampleCount; static int16_t CurrentWaveValue; - + /* In test tone mode, generate a square wave at 1/256 of the sample rate */ if (SquareWaveSampleCount++ == 0xFF) CurrentWaveValue ^= 0x8000; - + /* Only generate audio if the board button is being pressed */ AudioSample = (Buttons_GetStatus() & BUTTONS_BUTTON1) ? CurrentWaveValue : 0; #else @@ -226,12 +226,12 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) #if defined(MICROPHONE_BIASED_TO_HALF_RAIL) /* Microphone is biased to half rail voltage, subtract the bias from the sample value */ AudioSample -= (SAMPLE_MAX_RANGE / 2); - #endif + #endif #endif - + Pipe_Write_16_LE(AudioSample); Pipe_Write_16_LE(AudioSample); - + if (!(Pipe_IsReadWriteAllowed())) Pipe_ClearOUT(); } @@ -239,3 +239,4 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) Pipe_Freeze(); Pipe_SelectPipe(PrevPipe); } + diff --git a/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.c b/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.c index 33a02539e..4f6199d46 100644 --- a/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.c @@ -99,7 +99,7 @@ uint8_t ProcessConfigurationDescriptor(void) } /* Save the interface in case we need to refer back to it later */ - AudioControlInterface = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_Interface_t); + AudioControlInterface = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_Interface_t); /* Find the next Audio Streaming interface within that Audio Control interface */ if (USB_GetNextDescriptorComp(&CurrConfigBytesRem, &CurrConfigLocation, @@ -218,3 +218,4 @@ uint8_t DComp_NextAudioInterfaceDataEndpoint(void* CurrentDescriptor) return DESCRIPTOR_SEARCH_NotFound; } + diff --git a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.c b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.c index 720ad03e7..953bf12b4 100644 --- a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.c +++ b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.c @@ -51,7 +51,7 @@ int main(void) for (;;) { ReadNextReport(); - + USB_USBTask(); } } diff --git a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h index 0afaa4f4b..1660f4236 100644 --- a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h +++ b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h @@ -81,7 +81,7 @@ const uint8_t ReportIndex, const uint8_t ReportType, uint16_t ReportLength); - + void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.h b/Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.h index b71c3196c..cb938ef25 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.h +++ b/Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.h @@ -40,7 +40,7 @@ #include <LUFA/Drivers/USB/USB.h> #include "JoystickHostWithParser.h" - + /* Macros: */ /** HID Report Descriptor Usage Page value for a toggle button. */ #define USAGE_PAGE_BUTTON 0x09 @@ -55,7 +55,7 @@ #define USAGE_X 0x30 /** HID Report Descriptor Usage value for a Y axis movement. */ - #define USAGE_Y 0x31 + #define USAGE_Y 0x31 /* Enums: */ /** Enum for the possible return codes of the \ref GetHIDReportData() function. */ diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c index b38fcf07f..ccc1d68bc 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c +++ b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c @@ -99,7 +99,7 @@ void EVENT_USB_Host_DeviceUnattached(void) void EVENT_USB_Host_DeviceEnumerationComplete(void) { puts_P(PSTR("Getting Config Data.\r\n")); - + uint8_t ErrorCode; /* Get and process the configuration descriptor data */ @@ -179,7 +179,7 @@ void JoystickHost_Task(void) { if (USB_HostState != HOST_STATE_Configured) return; - + /* Select and unfreeze joystick data pipe */ Pipe_SelectPipe(JOYSTICK_DATA_IN_PIPE); Pipe_Unfreeze(); @@ -268,3 +268,4 @@ void ProcessJoystickReport(uint8_t* JoystickReport) /* Display the button information on the board LEDs */ LEDs_SetAllLEDs(LEDMask); } + diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h index f909e6667..237b6c26a 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h +++ b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h @@ -65,7 +65,7 @@ /** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */ #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3) - + /* Function Prototypes: */ void SetupHardware(void); void JoystickHost_Task(void); diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c index 4837076f2..6c9d6b9af 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c @@ -181,7 +181,7 @@ void KeyboardHost_Task(void) { if (USB_HostState != HOST_STATE_Configured) return; - + /* Select and unfreeze keyboard data pipe */ Pipe_SelectPipe(KEYBOARD_DATA_IN_PIPE); Pipe_Unfreeze(); @@ -259,7 +259,7 @@ void ProcessKeyboardReport(uint8_t* KeyboardReport) } else if (KeyCode == HID_KEYBOARD_SC_0_AND_CLOSING_PARENTHESIS) { - PressedKey = '0'; + PressedKey = '0'; } else if (KeyCode == HID_KEYBOARD_SC_SPACE) { diff --git a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c index e89b26168..31c886f66 100644 --- a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c +++ b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c @@ -165,7 +165,7 @@ void MIDIHost_Task(void) { if (USB_HostState != HOST_STATE_Configured) return; - + Pipe_SelectPipe(MIDI_DATA_IN_PIPE); if (Pipe_IsINReceived()) @@ -185,7 +185,7 @@ void MIDIHost_Task(void) printf_P(PSTR("MIDI Note %s - Channel %d, Pitch %d, Velocity %d\r\n"), NoteOnEvent ? "On" : "Off", ((MIDIEvent.Data1 & 0x0F) + 1), MIDIEvent.Data2, MIDIEvent.Data3); - } + } } Pipe_SelectPipe(MIDI_DATA_OUT_PIPE); diff --git a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c index 3546bb276..6f07fb706 100644 --- a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c +++ b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c @@ -108,7 +108,7 @@ static uint8_t MassStore_SendCommand(MS_CommandBlockWrapper_t* const SCSICommand return ErrorCode; } } - + /* Retrieve the returned SCSI status from the device */ MS_CommandStatusWrapper_t SCSIStatusBlock; return MassStore_GetReturnedStatus(&SCSIStatusBlock); @@ -267,7 +267,7 @@ static uint8_t MassStore_GetReturnedStatus(MS_CommandStatusWrapper_t* const SCSI { return ErrorCode; } - + /* Clear the data ready for next reception */ Pipe_ClearIN(); @@ -302,13 +302,13 @@ uint8_t MassStore_MassStorageReset(void) /* Select the control pipe for the request transfer */ Pipe_SelectPipe(PIPE_CONTROLPIPE); - + if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful) return ErrorCode; - + /* Select first data pipe to clear STALL condition if one exists */ Pipe_SelectPipe(MASS_STORE_DATA_IN_PIPE); - + if ((ErrorCode = USB_Host_ClearEndpointStall(Pipe_GetBoundEndpointAddress())) != HOST_SENDCONTROL_Successful) return ErrorCode; @@ -317,7 +317,7 @@ uint8_t MassStore_MassStorageReset(void) if ((ErrorCode = USB_Host_ClearEndpointStall(Pipe_GetBoundEndpointAddress())) != HOST_SENDCONTROL_Successful) return ErrorCode; - + return HOST_SENDCONTROL_Successful; } diff --git a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c index 188f72c00..8b47dd444 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c +++ b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c @@ -284,3 +284,4 @@ void ProcessMouseReport(uint8_t* MouseReport) /* Display the button information on the board LEDs */ LEDs_SetAllLEDs(LEDMask); } + diff --git a/Demos/Host/LowLevel/PrinterHost/PrinterHost.c b/Demos/Host/LowLevel/PrinterHost/PrinterHost.c index 59e239e0b..94403db7f 100644 --- a/Demos/Host/LowLevel/PrinterHost/PrinterHost.c +++ b/Demos/Host/LowLevel/PrinterHost/PrinterHost.c @@ -218,7 +218,7 @@ void PrinterHost_Task(void) puts_P(PSTR("Test Page Sent.\r\n")); /* Indicate device no longer busy */ - LEDs_SetAllLEDs(LEDMASK_USB_READY); + LEDs_SetAllLEDs(LEDMASK_USB_READY); USB_Host_SetDeviceConfiguration(0); } diff --git a/Demos/Host/LowLevel/PrinterHost/PrinterHost.h b/Demos/Host/LowLevel/PrinterHost/PrinterHost.h index 4e813a93a..75c3771c0 100644 --- a/Demos/Host/LowLevel/PrinterHost/PrinterHost.h +++ b/Demos/Host/LowLevel/PrinterHost/PrinterHost.h @@ -83,6 +83,6 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); - + #endif diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.c b/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.c index 84f18dbea..e52f55936 100644 --- a/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.c @@ -222,7 +222,7 @@ uint8_t DComp_NextCDCDataInterfaceEndpoint(void* CurrentDescriptor) USB_Descriptor_Endpoint_t* Endpoint = DESCRIPTOR_PCAST(CurrentDescriptor, USB_Descriptor_Endpoint_t); /* Check the endpoint type, break out if correct BULK or INTERRUPT type endpoint found */ - if (((Endpoint->Attributes & EP_TYPE_MASK) == EP_TYPE_BULK) || + if (((Endpoint->Attributes & EP_TYPE_MASK) == EP_TYPE_BULK) || ((Endpoint->Attributes & EP_TYPE_MASK) == EP_TYPE_INTERRUPT)) { return DESCRIPTOR_SEARCH_Found; diff --git a/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c b/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c index 045de9d4c..492988ebe 100644 --- a/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c @@ -177,7 +177,7 @@ uint8_t DComp_NextStillImageInterfaceDataEndpoint(void* CurrentDescriptor) USB_Descriptor_Endpoint_t* Endpoint = DESCRIPTOR_PCAST(CurrentDescriptor, USB_Descriptor_Endpoint_t); /* Check the endpoint type, break out if correct BULK or INTERRUPT type endpoint found */ - if (((Endpoint->Attributes & EP_TYPE_MASK) == EP_TYPE_BULK) || + if (((Endpoint->Attributes & EP_TYPE_MASK) == EP_TYPE_BULK) || ((Endpoint->Attributes & EP_TYPE_MASK) == EP_TYPE_INTERRUPT)) { return DESCRIPTOR_SEARCH_Found; diff --git a/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.c b/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.c index be1bb27ad..b76eb725b 100644 --- a/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.c @@ -221,7 +221,7 @@ uint8_t DComp_NextCDCDataInterfaceEndpoint(void* CurrentDescriptor) { USB_Descriptor_Endpoint_t* Endpoint = DESCRIPTOR_PCAST(CurrentDescriptor, USB_Descriptor_Endpoint_t); - if (((Endpoint->Attributes & EP_TYPE_MASK) == EP_TYPE_BULK) || + if (((Endpoint->Attributes & EP_TYPE_MASK) == EP_TYPE_BULK) || ((Endpoint->Attributes & EP_TYPE_MASK) == EP_TYPE_INTERRUPT)) { return DESCRIPTOR_SEARCH_Found; |