aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-04-16 08:50:34 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-04-16 08:50:34 +0000
commit8f6b4ddf764c3a54e42d00a7502c82c5c3e71b1c (patch)
tree65c37548f19c26de3971639067d6f290095f5843 /Demos/Host
parentef06bfd1c0ef5272c32808e23d0fd60d2d1bca9c (diff)
downloadlufa-8f6b4ddf764c3a54e42d00a7502c82c5c3e71b1c.tar.gz
lufa-8f6b4ddf764c3a54e42d00a7502c82c5c3e71b1c.tar.bz2
lufa-8f6b4ddf764c3a54e42d00a7502c82c5c3e71b1c.zip
Fixed GenericHIDHost demo report write routine incorrect for control type requests (thanks to Andrei Krainev).
Removed Endpoint_ClearCurrentBank() and Pipe_ClearCurrentBank() in favour of new Endpoint_ClearIN(), Endpoint_ClearOUT(), Endpoint_ClearControlIN(), Endpoint_ClearControlOUT(), Pipe_ClearIN(), Pipe_ClearOUT(), Pipe_ClearControlIN() and Pipe_ClearControlOUT() macros (done to allow for the detection of packets of zero length). Renamed *_ReadWriteAllowed() macros to *_IsReadWriteAllowed() to remain consistent with the rest of the LUFA API. Endpoint_IsSetupReceived() macro has been renamed to Endpoint_IsSETUPReceived(), Endpoint_ClearSetupReceived() macro has been renamed to Endpoint_ClearControlSETUP(), the Pipe_IsSetupSent() macro has been renamed to Pipe_IsSETUPSent() and the Pipe_ClearSetupSent() macro is no longer applicable and should be removed - changes made to compliment the new endpoint and pipe bank management API. Updated all demos, bootloaders and projects to use the new endpoint and pipe management APIs (thanks to Roman Thiel). Updated library doxygen documentation, added groups, changed documentation macro functions to real functions for clarity. Removed old endpoint and pipe aliased read/write/discard routines which did not have an explicit endian specifier for clarity. Removed the ButtLoadTag.h header file, as no one used for its intended purpose anyway.
Diffstat (limited to 'Demos/Host')
-rw-r--r--Demos/Host/CDCHost/CDCHost.c44
-rw-r--r--Demos/Host/CDCHost/CDCHost.h1
-rw-r--r--Demos/Host/CDCHost/ConfigDescriptor.h1
-rw-r--r--Demos/Host/GenericHIDHost/ConfigDescriptor.h1
-rw-r--r--Demos/Host/GenericHIDHost/GenericHIDHost.c40
-rw-r--r--Demos/Host/GenericHIDHost/GenericHIDHost.h3
-rw-r--r--Demos/Host/KeyboardHost/ConfigDescriptor.h1
-rw-r--r--Demos/Host/KeyboardHost/KeyboardHost.c83
-rw-r--r--Demos/Host/KeyboardHost/KeyboardHost.h1
-rw-r--r--Demos/Host/KeyboardHostWithParser/ConfigDescriptor.h1
-rw-r--r--Demos/Host/KeyboardHostWithParser/HIDReport.h2
-rw-r--r--Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.c141
-rw-r--r--Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.h2
-rw-r--r--Demos/Host/MassStorageHost/ConfigDescriptor.h1
-rw-r--r--Demos/Host/MassStorageHost/MassStorageHost.c6
-rw-r--r--Demos/Host/MassStorageHost/MassStorageHost.h1
-rw-r--r--Demos/Host/MassStorageHost/MassStoreCommands.c19
-rw-r--r--Demos/Host/MouseHost/ConfigDescriptor.h1
-rw-r--r--Demos/Host/MouseHost/MouseHost.c72
-rw-r--r--Demos/Host/MouseHost/MouseHost.h1
-rw-r--r--Demos/Host/MouseHostWithParser/ConfigDescriptor.h1
-rw-r--r--Demos/Host/MouseHostWithParser/HIDReport.h2
-rw-r--r--Demos/Host/MouseHostWithParser/MouseHostWithParser.c156
-rw-r--r--Demos/Host/MouseHostWithParser/MouseHostWithParser.h4
-rw-r--r--Demos/Host/StillImageHost/ConfigDescriptor.h1
-rw-r--r--Demos/Host/StillImageHost/StillImageCommands.c10
-rw-r--r--Demos/Host/StillImageHost/StillImageHost.c7
-rw-r--r--Demos/Host/StillImageHost/StillImageHost.h1
28 files changed, 296 insertions, 308 deletions
diff --git a/Demos/Host/CDCHost/CDCHost.c b/Demos/Host/CDCHost/CDCHost.c
index 9ecf060b3..80d993953 100644
--- a/Demos/Host/CDCHost/CDCHost.c
+++ b/Demos/Host/CDCHost/CDCHost.c
@@ -36,12 +36,6 @@
#include "CDCHost.h"
-/* Project Tags, for reading out using the ButtLoad project */
-BUTTLOADTAG(ProjName, "LUFA CDC Host App");
-BUTTLOADTAG(BuildTime, __TIME__);
-BUTTLOADTAG(BuildDate, __DATE__);
-BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
-
/* Scheduler Task List */
TASK_LIST
{
@@ -244,33 +238,37 @@ TASK(USB_CDC_Host)
/* Select and the data IN pipe */
Pipe_SelectPipe(CDC_DATAPIPE_IN);
- /* Check if data is in the pipe */
- if (Pipe_ReadWriteAllowed())
+ /* Check to see if a packet has been received */
+ if (Pipe_IsINReceived())
{
- /* Get the length of the pipe data, and create a new buffer to hold it */
- uint16_t BufferLength = Pipe_BytesInPipe();
- uint8_t Buffer[BufferLength];
-
- /* Read in the pipe data to the temporary buffer */
- Pipe_Read_Stream_LE(Buffer, BufferLength);
-
+ /* Check if data is in the pipe */
+ if (Pipe_IsReadWriteAllowed())
+ {
+ /* Get the length of the pipe data, and create a new buffer to hold it */
+ uint16_t BufferLength = Pipe_BytesInPipe();
+ uint8_t Buffer[BufferLength];
+
+ /* Read in the pipe data to the temporary buffer */
+ Pipe_Read_Stream_LE(Buffer, BufferLength);
+
+ /* Print out the buffer contents to the USART */
+ for (uint16_t BufferByte = 0; BufferByte < BufferLength; BufferByte++)
+ putchar(Buffer[BufferByte]);
+ }
+
/* Clear the pipe after it is read, ready for the next packet */
- Pipe_ClearCurrentBank();
-
- /* Print out the buffer contents to the USART */
- for (uint16_t BufferByte = 0; BufferByte < BufferLength; BufferByte++)
- putchar(Buffer[BufferByte]);
+ Pipe_ClearIN();
}
/* Select and unfreeze the notification pipe */
Pipe_SelectPipe(CDC_NOTIFICATIONPIPE);
Pipe_Unfreeze();
- /* Check if data is in the pipe */
- if (Pipe_ReadWriteAllowed())
+ /* Check if a packet has been received */
+ if (Pipe_IsINReceived())
{
/* Discard the event notification */
- Pipe_ClearCurrentBank();
+ Pipe_ClearIN();
}
/* Freeze notification IN pipe after use */
diff --git a/Demos/Host/CDCHost/CDCHost.h b/Demos/Host/CDCHost/CDCHost.h
index 21b9d67ed..c348acaef 100644
--- a/Demos/Host/CDCHost/CDCHost.h
+++ b/Demos/Host/CDCHost/CDCHost.h
@@ -44,7 +44,6 @@
#include <stdio.h>
#include <LUFA/Version.h> // Library Version Information
- #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
#include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
#include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // Serial stream driver
diff --git a/Demos/Host/CDCHost/ConfigDescriptor.h b/Demos/Host/CDCHost/ConfigDescriptor.h
index 9db4b6505..ea00f610f 100644
--- a/Demos/Host/CDCHost/ConfigDescriptor.h
+++ b/Demos/Host/CDCHost/ConfigDescriptor.h
@@ -38,7 +38,6 @@
/* Includes: */
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
- #include <LUFA/Drivers/USB/Class/ConfigDescriptor.h> // Configuration Descriptor Parser
#include "CDCHost.h"
diff --git a/Demos/Host/GenericHIDHost/ConfigDescriptor.h b/Demos/Host/GenericHIDHost/ConfigDescriptor.h
index e35801a01..fac772979 100644
--- a/Demos/Host/GenericHIDHost/ConfigDescriptor.h
+++ b/Demos/Host/GenericHIDHost/ConfigDescriptor.h
@@ -38,7 +38,6 @@
/* Includes: */
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
- #include <LUFA/Drivers/USB/Class/ConfigDescriptor.h> // Configuration Descriptor Parser
#include "GenericHIDHost.h"
diff --git a/Demos/Host/GenericHIDHost/GenericHIDHost.c b/Demos/Host/GenericHIDHost/GenericHIDHost.c
index 716f1c333..b047841f6 100644
--- a/Demos/Host/GenericHIDHost/GenericHIDHost.c
+++ b/Demos/Host/GenericHIDHost/GenericHIDHost.c
@@ -36,12 +36,6 @@
#include "GenericHIDHost.h"
-/* Project Tags, for reading out using the ButtLoad project */
-BUTTLOADTAG(ProjName, "LUFA GenHid Host App");
-BUTTLOADTAG(BuildTime, __TIME__);
-BUTTLOADTAG(BuildDate, __DATE__);
-BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
-
/* Scheduler Task List */
TASK_LIST
{
@@ -185,30 +179,34 @@ void ReadNextReport(void)
Pipe_SelectPipe(HID_DATA_IN_PIPE);
Pipe_Unfreeze();
- /* Ensure pipe contains data and is ready to be read before continuing */
- if (!(Pipe_ReadWriteAllowed()))
+ /* Check to see if a packet has been received */
+ if (!(Pipe_IsINReceived()))
{
#if !defined(INTERRUPT_DATA_PIPE)
/* Refreeze HID data IN pipe */
Pipe_Freeze();
#endif
-
+
return;
}
- uint8_t ReportINData[Pipe_BytesInPipe()];
+ /* Ensure pipe contains data before trying to read from it */
+ if (Pipe_IsReadWriteAllowed())
+ {
+ uint8_t ReportINData[Pipe_BytesInPipe()];
- /* Read in HID report data */
- Pipe_Read_Stream_LE(&ReportINData, sizeof(ReportINData));
+ /* Read in HID report data */
+ Pipe_Read_Stream_LE(&ReportINData, sizeof(ReportINData));
+
+ /* Print report data through the serial port */
+ for (uint16_t CurrByte = 0; CurrByte < sizeof(ReportINData); CurrByte++)
+ printf_P(PSTR("0x%02X "), ReportINData[CurrByte]);
+
+ puts_P(PSTR("\r\n"));
+ }
/* Clear the IN endpoint, ready for next data packet */
- Pipe_ClearCurrentBank();
-
- /* Print report data through the serial port */
- for (uint16_t CurrByte = 0; CurrByte < sizeof(ReportINData); CurrByte++)
- printf_P(PSTR("0x%02X "), ReportINData[CurrByte]);
-
- puts_P(PSTR("\r\n"));
+ Pipe_ClearIN();
#if !defined(INTERRUPT_DATA_PIPE)
/* Refreeze HID data IN pipe */
@@ -235,7 +233,7 @@ void WriteNextReport(uint8_t* ReportOUTData, uint8_t ReportIndex, uint8_t Report
Pipe_Unfreeze();
/* Ensure pipe is ready to be written to before continuing */
- if (!(Pipe_ReadWriteAllowed()))
+ if (!(Pipe_IsOUTReady()))
{
/* Refreeze the data OUT pipe */
Pipe_Freeze();
@@ -251,7 +249,7 @@ void WriteNextReport(uint8_t* ReportOUTData, uint8_t ReportIndex, uint8_t Report
Pipe_Write_Stream_LE(ReportOUTData, ReportLength);
/* Clear the OUT endpoint, send last data packet */
- Pipe_ClearCurrentBank();
+ Pipe_ClearOUT();
/* Refreeze the data OUT pipe */
Pipe_Freeze();
diff --git a/Demos/Host/GenericHIDHost/GenericHIDHost.h b/Demos/Host/GenericHIDHost/GenericHIDHost.h
index 99b4599f1..8483fa686 100644
--- a/Demos/Host/GenericHIDHost/GenericHIDHost.h
+++ b/Demos/Host/GenericHIDHost/GenericHIDHost.h
@@ -45,7 +45,6 @@
#include <stdio.h>
#include <LUFA/Version.h> // Library Version Information
- #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
#include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
#include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // Serial stream driver
@@ -94,6 +93,6 @@
/* Function Prototypes: */
void UpdateStatus(uint8_t CurrentStatus);
void ReadNextReport(void);
- void WriteNextReport(uint8_t* ReportOUTData, uint16_t ReportLength);
+ void WriteNextReport(uint8_t* ReportOUTData, uint8_t ReportIndex, uint8_t ReportType, uint16_t ReportLength);
#endif
diff --git a/Demos/Host/KeyboardHost/ConfigDescriptor.h b/Demos/Host/KeyboardHost/ConfigDescriptor.h
index 1d168b453..416315b97 100644
--- a/Demos/Host/KeyboardHost/ConfigDescriptor.h
+++ b/Demos/Host/KeyboardHost/ConfigDescriptor.h
@@ -38,7 +38,6 @@
/* Includes: */
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
- #include <LUFA/Drivers/USB/Class/ConfigDescriptor.h> // Configuration Descriptor Parser
#include "KeyboardHost.h"
diff --git a/Demos/Host/KeyboardHost/KeyboardHost.c b/Demos/Host/KeyboardHost/KeyboardHost.c
index 947f23281..35055ca79 100644
--- a/Demos/Host/KeyboardHost/KeyboardHost.c
+++ b/Demos/Host/KeyboardHost/KeyboardHost.c
@@ -36,12 +36,6 @@
#include "KeyboardHost.h"
-/* Project Tags, for reading out using the ButtLoad project */
-BUTTLOADTAG(ProjName, "LUFA KBD Host App");
-BUTTLOADTAG(BuildTime, __TIME__);
-BUTTLOADTAG(BuildDate, __DATE__);
-BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
-
/* Scheduler Task List */
TASK_LIST
{
@@ -191,52 +185,57 @@ void ReadNextReport(void)
Pipe_Unfreeze();
#endif
- /* Ensure pipe contains data and is ready to be read before continuing */
- if (!(Pipe_ReadWriteAllowed()))
+ /* Check to see if a packet has been received */
+ if (!(Pipe_IsINReceived()))
{
#if !defined(INTERRUPT_DATA_PIPE)
- /* Refreeze keyboard data pipe */
+ /* Refreeze HID data IN pipe */
Pipe_Freeze();
#endif
-
+
return;
}
- /* Read in keyboard report data */
- Pipe_Read_Stream_LE(&KeyboardReport, sizeof(KeyboardReport));
-
- /* Clear the IN endpoint, ready for next data packet */
- Pipe_ClearCurrentBank();
-
- /* Indicate if the modifier byte is non-zero (special key such as shift is being pressed) */
- LEDs_ChangeLEDs(LEDS_LED1, (KeyboardReport.Modifier) ? LEDS_LED1 : 0);
-
- /* Check if a key has been pressed */
- if (KeyboardReport.KeyCode)
+ /* Ensure pipe contains data before trying to read from it */
+ if (Pipe_IsReadWriteAllowed())
{
- /* Toggle status LED to indicate keypress */
- if (LEDs_GetLEDs() & LEDS_LED2)
- LEDs_TurnOffLEDs(LEDS_LED2);
- else
- LEDs_TurnOnLEDs(LEDS_LED2);
-
- char PressedKey = 0;
-
- /* Retrieve pressed key character if alphanumeric */
- if ((KeyboardReport.KeyCode >= 0x04) && (KeyboardReport.KeyCode <= 0x1D))
- PressedKey = (KeyboardReport.KeyCode - 0x04) + 'A';
- else if ((KeyboardReport.KeyCode >= 0x1E) && (KeyboardReport.KeyCode <= 0x27))
- PressedKey = (KeyboardReport.KeyCode - 0x1E) + '0';
- else if (KeyboardReport.KeyCode == 0x2C)
- PressedKey = ' ';
- else if (KeyboardReport.KeyCode == 0x28)
- PressedKey = '\n';
-
- /* Print the pressed key character out through the serial port if valid */
- if (PressedKey)
- putchar(PressedKey);
+ /* Read in keyboard report data */
+ Pipe_Read_Stream_LE(&KeyboardReport, sizeof(KeyboardReport));
+
+ /* Indicate if the modifier byte is non-zero (special key such as shift is being pressed) */
+ LEDs_ChangeLEDs(LEDS_LED1, (KeyboardReport.Modifier) ? LEDS_LED1 : 0);
+
+ /* Check if a key has been pressed */
+ if (KeyboardReport.KeyCode)
+ {
+ /* Toggle status LED to indicate keypress */
+ if (LEDs_GetLEDs() & LEDS_LED2)
+ LEDs_TurnOffLEDs(LEDS_LED2);
+ else
+ LEDs_TurnOnLEDs(LEDS_LED2);
+
+ char PressedKey = 0;
+
+ /* Retrieve pressed key character if alphanumeric */
+ if ((KeyboardReport.KeyCode >= 0x04) && (KeyboardReport.KeyCode <= 0x1D))
+ PressedKey = (KeyboardReport.KeyCode - 0x04) + 'A';
+ else if ((KeyboardReport.KeyCode >= 0x1E) && (KeyboardReport.KeyCode <= 0x27))
+ PressedKey = (KeyboardReport.KeyCode - 0x1E) + '0';
+ else if (KeyboardReport.KeyCode == 0x2C)
+ PressedKey = ' ';
+ else if (KeyboardReport.KeyCode == 0x28)
+ PressedKey = '\n';
+
+ /* Print the pressed key character out through the serial port if valid */
+ if (PressedKey)
+ putchar(PressedKey);
+ }
}
+
+ /* Clear the IN endpoint, ready for next data packet */
+ Pipe_ClearIN();
+
#if !defined(INTERRUPT_DATA_PIPE)
/* Refreeze keyboard data pipe */
Pipe_Freeze();
diff --git a/Demos/Host/KeyboardHost/KeyboardHost.h b/Demos/Host/KeyboardHost/KeyboardHost.h
index 8c1a70915..2c541f6a5 100644
--- a/Demos/Host/KeyboardHost/KeyboardHost.h
+++ b/Demos/Host/KeyboardHost/KeyboardHost.h
@@ -45,7 +45,6 @@
#include <stdio.h>
#include <LUFA/Version.h> // Library Version Information
- #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
#include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
#include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // Serial stream driver
diff --git a/Demos/Host/KeyboardHostWithParser/ConfigDescriptor.h b/Demos/Host/KeyboardHostWithParser/ConfigDescriptor.h
index e007a942a..1deff6328 100644
--- a/Demos/Host/KeyboardHostWithParser/ConfigDescriptor.h
+++ b/Demos/Host/KeyboardHostWithParser/ConfigDescriptor.h
@@ -38,7 +38,6 @@
/* Includes: */
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
- #include <LUFA/Drivers/USB/Class/ConfigDescriptor.h> // Configuration Descriptor Parser
#include "HIDReport.h"
diff --git a/Demos/Host/KeyboardHostWithParser/HIDReport.h b/Demos/Host/KeyboardHostWithParser/HIDReport.h
index 7c59138c2..a128b8e97 100644
--- a/Demos/Host/KeyboardHostWithParser/HIDReport.h
+++ b/Demos/Host/KeyboardHostWithParser/HIDReport.h
@@ -37,7 +37,7 @@
#define _HID_REPORT_H_
/* Includes: */
- #include <LUFA/Drivers/USB/Class/HIDParser.h> // HID Class Report Parser
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
#include "KeyboardHostWithParser.h"
diff --git a/Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.c
index d19929d4d..d7d5f9414 100644
--- a/Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.c
+++ b/Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.c
@@ -36,12 +36,6 @@
#include "KeyboardHostWithParser.h"
-/* Project Tags, for reading out using the ButtLoad project */
-BUTTLOADTAG(ProjName, "LUFA KBD Host App");
-BUTTLOADTAG(BuildTime, __TIME__);
-BUTTLOADTAG(BuildDate, __DATE__);
-BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
-
/* Scheduler Task List */
TASK_LIST
{
@@ -270,70 +264,24 @@ TASK(USB_Keyboard_Host)
Pipe_SelectPipe(KEYBOARD_DATAPIPE);
Pipe_Unfreeze();
- /* Check if data has been received from the attached keyboard */
- if (Pipe_ReadWriteAllowed())
+ /* Check to see if a packet has been received */
+ if (Pipe_IsINReceived())
{
- /* Create buffer big enough for the report */
- uint8_t KeyboardReport[Pipe_BytesInPipe()];
+ /* Check if data has been received from the attached keyboard */
+ if (Pipe_IsReadWriteAllowed())
+ {
+ /* Create buffer big enough for the report */
+ uint8_t KeyboardReport[Pipe_BytesInPipe()];
- /* Load in the keyboard report */
- Pipe_Read_Stream_LE(KeyboardReport, Pipe_BytesInPipe());
+ /* Load in the keyboard report */
+ Pipe_Read_Stream_LE(KeyboardReport, Pipe_BytesInPipe());
- /* Clear the IN endpoint, ready for next data packet */
- Pipe_ClearCurrentBank();
-
- /* Check each HID report item in turn, looking for keyboard scan code reports */
- for (uint8_t ReportNumber = 0; ReportNumber < HIDReportInfo.TotalReportItems; ReportNumber++)
- {
- /* Create a temporary item pointer to the next report item */
- HID_ReportItem_t* ReportItem = &HIDReportInfo.ReportItems[ReportNumber];
-
- /* Check if the current report item is a keyboard scancode */
- if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_KEYBOARD) &&
- (ReportItem->Attributes.BitSize == 8) &&
- (ReportItem->Attributes.Logical.Maximum > 1) &&
- (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
- {
- /* Retrieve the keyboard scancode from the report data retrieved from the device */
- bool FoundData = GetReportItemInfo(KeyboardReport, ReportItem);
-
- /* For multi-report devices - if the requested data was not in the issued report, continue */
- if (!(FoundData))
- continue;
-
- /* Key code is an unsigned char in length, cast to the appropriate type */
- uint8_t KeyCode = (uint8_t)ReportItem->Value;
-
- /* If scancode is non-zero, a key is being pressed */
- if (KeyCode)
- {
- /* Toggle status LED to indicate keypress */
- if (LEDs_GetLEDs() & LEDS_LED2)
- LEDs_TurnOffLEDs(LEDS_LED2);
- else
- LEDs_TurnOnLEDs(LEDS_LED2);
-
- char PressedKey = 0;
-
- /* Convert scancode to printable character if alphanumeric */
- if ((KeyCode >= 0x04) && (KeyCode <= 0x1D))
- PressedKey = (KeyCode - 0x04) + 'A';
- else if ((KeyCode >= 0x1E) && (KeyCode <= 0x27))
- PressedKey = (KeyCode - 0x1E) + '0';
- else if (KeyCode == 0x2C)
- PressedKey = ' ';
- else if (KeyCode == 0x28)
- PressedKey = '\n';
-
- /* Print the pressed key character out through the serial port if valid */
- if (PressedKey)
- putchar(PressedKey);
- }
-
- /* Once a scancode is found, stop scanning through the report items */
- break;
- }
+ /* Process the read in keyboard report from the device */
+ ProcessKeyboardReport(KeyboardReport);
}
+
+ /* Clear the IN endpoint, ready for next data packet */
+ Pipe_ClearIN();
}
/* Freeze keyboard data pipe */
@@ -341,3 +289,64 @@ TASK(USB_Keyboard_Host)
break;
}
}
+
+/** Processes a read HID report from an attached keyboard, extracting out elements via the HID parser results
+ * as required and prints pressed characters to the serial port. Each time a key is typed, a board LED is toggled.
+ *
+ * \param KeyboardReport Pointer to a HID report from an attached keyboard device
+ */
+void ProcessKeyboardReport(uint8_t* KeyboardReport)
+{
+ /* Check each HID report item in turn, looking for keyboard scan code reports */
+ for (uint8_t ReportNumber = 0; ReportNumber < HIDReportInfo.TotalReportItems; ReportNumber++)
+ {
+ /* Create a temporary item pointer to the next report item */
+ HID_ReportItem_t* ReportItem = &HIDReportInfo.ReportItems[ReportNumber];
+
+ /* Check if the current report item is a keyboard scancode */
+ if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_KEYBOARD) &&
+ (ReportItem->Attributes.BitSize == 8) &&
+ (ReportItem->Attributes.Logical.Maximum > 1) &&
+ (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
+ {
+ /* Retrieve the keyboard scancode from the report data retrieved from the device */
+ bool FoundData = GetReportItemInfo(KeyboardReport, ReportItem);
+
+ /* For multi-report devices - if the requested data was not in the issued report, continue */
+ if (!(FoundData))
+ continue;
+
+ /* Key code is an unsigned char in length, cast to the appropriate type */
+ uint8_t KeyCode = (uint8_t)ReportItem->Value;
+
+ /* If scancode is non-zero, a key is being pressed */
+ if (KeyCode)
+ {
+ /* Toggle status LED to indicate keypress */
+ if (LEDs_GetLEDs() & LEDS_LED2)
+ LEDs_TurnOffLEDs(LEDS_LED2);
+ else
+ LEDs_TurnOnLEDs(LEDS_LED2);
+
+ char PressedKey = 0;
+
+ /* Convert scancode to printable character if alphanumeric */
+ if ((KeyCode >= 0x04) && (KeyCode <= 0x1D))
+ PressedKey = (KeyCode - 0x04) + 'A';
+ else if ((KeyCode >= 0x1E) && (KeyCode <= 0x27))
+ PressedKey = (KeyCode - 0x1E) + '0';
+ else if (KeyCode == 0x2C)
+ PressedKey = ' ';
+ else if (KeyCode == 0x28)
+ PressedKey = '\n';
+
+ /* Print the pressed key character out through the serial port if valid */
+ if (PressedKey)
+ putchar(PressedKey);
+ }
+
+ /* Once a scancode is found, stop scanning through the report items */
+ break;
+ }
+ }
+}
diff --git a/Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.h b/Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.h
index fece67971..112dbfdec 100644
--- a/Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.h
+++ b/Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.h
@@ -39,7 +39,6 @@
#include <stdio.h>
#include <LUFA/Version.h> // Library Version Information
- #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
#include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
#include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // Serial stream driver
@@ -77,5 +76,6 @@
/* Function Prototypes: */
void UpdateStatus(uint8_t CurrentStatus);
+ void ProcessKeyboardReport(uint8_t* KeyboardReport);
#endif
diff --git a/Demos/Host/MassStorageHost/ConfigDescriptor.h b/Demos/Host/MassStorageHost/ConfigDescriptor.h
index 908cc2ba5..b02e08828 100644
--- a/Demos/Host/MassStorageHost/ConfigDescriptor.h
+++ b/Demos/Host/MassStorageHost/ConfigDescriptor.h
@@ -38,7 +38,6 @@
/* Includes: */
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
- #include <LUFA/Drivers/USB/Class/ConfigDescriptor.h> // Configuration Descriptor Parser
#include "MassStorageHost.h"
diff --git a/Demos/Host/MassStorageHost/MassStorageHost.c b/Demos/Host/MassStorageHost/MassStorageHost.c
index ec5bc6107..1c56e6eed 100644
--- a/Demos/Host/MassStorageHost/MassStorageHost.c
+++ b/Demos/Host/MassStorageHost/MassStorageHost.c
@@ -36,12 +36,6 @@
#include "MassStorageHost.h"
-/* Project Tags, for reading out using the ButtLoad project */
-BUTTLOADTAG(ProjName, "LUFA MS Host App");
-BUTTLOADTAG(BuildTime, __TIME__);
-BUTTLOADTAG(BuildDate, __DATE__);
-BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
-
/* Scheduler Task List */
TASK_LIST
{
diff --git a/Demos/Host/MassStorageHost/MassStorageHost.h b/Demos/Host/MassStorageHost/MassStorageHost.h
index 33e2d2538..73a69c0d8 100644
--- a/Demos/Host/MassStorageHost/MassStorageHost.h
+++ b/Demos/Host/MassStorageHost/MassStorageHost.h
@@ -48,7 +48,6 @@
#include "MassStoreCommands.h"
#include <LUFA/Version.h> // Library Version Information
- #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
#include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
#include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // Serial stream driver
diff --git a/Demos/Host/MassStorageHost/MassStoreCommands.c b/Demos/Host/MassStorageHost/MassStoreCommands.c
index bf736e79c..41c59dc43 100644
--- a/Demos/Host/MassStorageHost/MassStoreCommands.c
+++ b/Demos/Host/MassStorageHost/MassStoreCommands.c
@@ -88,7 +88,7 @@ static uint8_t MassStore_SendCommand(void)
return ErrorCode;
/* Send the data in the OUT pipe to the attached device */
- Pipe_ClearCurrentBank();
+ Pipe_ClearOUT();
/* Some buggy devices require a delay here before the pipe freezing or they will lock up */
USB_Host_WaitMS(1);
@@ -117,7 +117,7 @@ static uint8_t MassStore_WaitForDataReceived(void)
Pipe_Unfreeze();
/* Wait until data received in the IN pipe */
- while (!(Pipe_ReadWriteAllowed()))
+ while (!(Pipe_IsINReceived()))
{
/* Check to see if a new frame has been issued (1ms elapsed) */
if (USB_INT_HasOccurred(USB_INT_HSOFI))
@@ -183,6 +183,9 @@ static uint8_t MassStore_SendReceiveData(void* BufferPtr)
/* Read in the block data from the pipe */
if ((ErrorCode = Pipe_Read_Stream_LE(BufferPtr, BytesRem)) != PIPE_RWSTREAM_ERROR_NoError)
return ErrorCode;
+
+ /* Acknowledge the packet */
+ Pipe_ClearIN();
}
else
{
@@ -193,10 +196,10 @@ static uint8_t MassStore_SendReceiveData(void* BufferPtr)
/* Write the block data to the pipe */
if ((ErrorCode = Pipe_Write_Stream_LE(BufferPtr, BytesRem)) != PIPE_RWSTREAM_ERROR_NoError)
return ErrorCode;
+
+ /* Acknowledge the packet */
+ Pipe_ClearOUT();
}
-
- /* Acknowledge the packet */
- Pipe_ClearCurrentBank();
/* Some buggy devices require a delay here before the pipe freezing or they will lock up */
USB_Host_WaitMS(1);
@@ -216,8 +219,8 @@ static uint8_t MassStore_GetReturnedStatus(void)
uint8_t ErrorCode = PIPE_RWSTREAM_ERROR_NoError;
/* If an error in the command ocurred, abort */
- if (MassStore_WaitForDataReceived() != NoError)
- return;
+ if ((ErrorCode == MassStore_WaitForDataReceived()) != PIPE_RWSTREAM_ERROR_NoError)
+ return ErrorCode;
/* Select the IN data pipe for data reception */
Pipe_SelectPipe(MASS_STORE_DATA_IN_PIPE);
@@ -228,7 +231,7 @@ static uint8_t MassStore_GetReturnedStatus(void)
return ErrorCode;
/* Clear the data ready for next reception */
- Pipe_ClearCurrentBank();
+ Pipe_ClearIN();
/* Some buggy devices require a delay here before the pipe freezing or they will lock up */
USB_Host_WaitMS(1);
diff --git a/Demos/Host/MouseHost/ConfigDescriptor.h b/Demos/Host/MouseHost/ConfigDescriptor.h
index 22e733714..40286e546 100644
--- a/Demos/Host/MouseHost/ConfigDescriptor.h
+++ b/Demos/Host/MouseHost/ConfigDescriptor.h
@@ -38,7 +38,6 @@
/* Includes: */
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
- #include <LUFA/Drivers/USB/Class/ConfigDescriptor.h> // Configuration Descriptor Parser
#include "MouseHost.h"
diff --git a/Demos/Host/MouseHost/MouseHost.c b/Demos/Host/MouseHost/MouseHost.c
index ff2542834..6a59b4d59 100644
--- a/Demos/Host/MouseHost/MouseHost.c
+++ b/Demos/Host/MouseHost/MouseHost.c
@@ -36,12 +36,6 @@
#include "MouseHost.h"
-/* Project Tags, for reading out using the ButtLoad project */
-BUTTLOADTAG(ProjName, "LUFA Mouse Host App");
-BUTTLOADTAG(BuildTime, __TIME__);
-BUTTLOADTAG(BuildDate, __DATE__);
-BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
-
/* Scheduler Task List */
TASK_LIST
{
@@ -188,49 +182,53 @@ void ReadNextReport(void)
Pipe_SelectPipe(MOUSE_DATAPIPE);
#if !defined(INTERRUPT_DATA_PIPE)
- /* Unfreeze mouse data pipe */
+ /* Unfreeze keyboard data pipe */
Pipe_Unfreeze();
#endif
- /* Ensure pipe contains data and is ready to be read before continuing */
- if (!(Pipe_ReadWriteAllowed()))
+ /* Check to see if a packet has been received */
+ if (!(Pipe_IsINReceived()))
{
#if !defined(INTERRUPT_DATA_PIPE)
- /* Refreeze mouse data pipe */
+ /* Refreeze HID data IN pipe */
Pipe_Freeze();
#endif
-
+
return;
}
- /* Read in mouse report data */
- Pipe_Read_Stream_LE(&MouseReport, sizeof(MouseReport));
-
- /* Clear the IN endpoint, ready for next data packet */
- Pipe_ClearCurrentBank();
+ /* Ensure pipe contains data before trying to read from it */
+ if (Pipe_IsReadWriteAllowed())
+ {
+ /* Read in mouse report data */
+ Pipe_Read_Stream_LE(&MouseReport, sizeof(MouseReport));
+
+ /* Alter status LEDs according to mouse X movement */
+ if (MouseReport.X > 0)
+ LEDMask |= LEDS_LED1;
+ else if (MouseReport.X < 0)
+ LEDMask |= LEDS_LED2;
+
+ /* Alter status LEDs according to mouse Y movement */
+ if (MouseReport.Y > 0)
+ LEDMask |= LEDS_LED3;
+ else if (MouseReport.Y < 0)
+ LEDMask |= LEDS_LED4;
+
+ /* Alter status LEDs according to mouse button position */
+ if (MouseReport.Button)
+ LEDMask = LEDS_ALL_LEDS;
- /* Alter status LEDs according to mouse X movement */
- if (MouseReport.X > 0)
- LEDMask |= LEDS_LED1;
- else if (MouseReport.X < 0)
- LEDMask |= LEDS_LED2;
+ LEDs_SetAllLEDs(LEDMask);
- /* Alter status LEDs according to mouse Y movement */
- if (MouseReport.Y > 0)
- LEDMask |= LEDS_LED3;
- else if (MouseReport.Y < 0)
- LEDMask |= LEDS_LED4;
-
- /* Alter status LEDs according to mouse button position */
- if (MouseReport.Button)
- LEDMask = LEDS_ALL_LEDS;
-
- LEDs_SetAllLEDs(LEDMask);
-
- /* Print mouse report data through the serial port */
- printf_P(PSTR("dX:%2d dY:%2d Button:%d\r\n"), MouseReport.X,
- MouseReport.Y,
- MouseReport.Button);
+ /* Print mouse report data through the serial port */
+ printf_P(PSTR("dX:%2d dY:%2d Button:%d\r\n"), MouseReport.X,
+ MouseReport.Y,
+ MouseReport.Button);
+ }
+
+ /* Clear the IN endpoint, ready for next data packet */
+ Pipe_ClearIN();
#if !defined(INTERRUPT_DATA_PIPE)
/* Refreeze mouse data pipe */
diff --git a/Demos/Host/MouseHost/MouseHost.h b/Demos/Host/MouseHost/MouseHost.h
index b72e09cd2..c7e5d2be2 100644
--- a/Demos/Host/MouseHost/MouseHost.h
+++ b/Demos/Host/MouseHost/MouseHost.h
@@ -45,7 +45,6 @@
#include <stdio.h>
#include <LUFA/Version.h> // Library Version Information
- #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
#include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
#include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // Serial stream driver
diff --git a/Demos/Host/MouseHostWithParser/ConfigDescriptor.h b/Demos/Host/MouseHostWithParser/ConfigDescriptor.h
index 971bdfeef..7cb12dbca 100644
--- a/Demos/Host/MouseHostWithParser/ConfigDescriptor.h
+++ b/Demos/Host/MouseHostWithParser/ConfigDescriptor.h
@@ -38,7 +38,6 @@
/* Includes: */
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
- #include <LUFA/Drivers/USB/Class/ConfigDescriptor.h> // Configuration Descriptor Parser
#include "HIDReport.h"
diff --git a/Demos/Host/MouseHostWithParser/HIDReport.h b/Demos/Host/MouseHostWithParser/HIDReport.h
index aa259a114..f5ad40be3 100644
--- a/Demos/Host/MouseHostWithParser/HIDReport.h
+++ b/Demos/Host/MouseHostWithParser/HIDReport.h
@@ -37,7 +37,7 @@
#define _HID_REPORT_H_
/* Includes: */
- #include <LUFA/Drivers/USB/Class/HIDParser.h> // HID Class Report Parser
+ #include <LUFA/Drivers/USB/USB.h> // HID Class Report Parser
#include "MouseHostWithParser.h"
diff --git a/Demos/Host/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/MouseHostWithParser/MouseHostWithParser.c
index 6aeca4ba5..259da2a60 100644
--- a/Demos/Host/MouseHostWithParser/MouseHostWithParser.c
+++ b/Demos/Host/MouseHostWithParser/MouseHostWithParser.c
@@ -36,12 +36,6 @@
#include "MouseHostWithParser.h"
-/* Project Tags, for reading out using the ButtLoad project */
-BUTTLOADTAG(ProjName, "LUFA Mouse Host App");
-BUTTLOADTAG(BuildTime, __TIME__);
-BUTTLOADTAG(BuildDate, __DATE__);
-BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
-
/* Scheduler Task List */
TASK_LIST
{
@@ -271,79 +265,24 @@ TASK(USB_Mouse_Host)
Pipe_SelectPipe(MOUSE_DATAPIPE);
Pipe_Unfreeze();
- /* Check if data has been received from the attached mouse */
- if (Pipe_ReadWriteAllowed())
+ /* Check to see if a packet has been received */
+ if (Pipe_IsINReceived())
{
- uint8_t LEDMask = LEDS_NO_LEDS;
-
- /* Create buffer big enough for the report */
- uint8_t MouseReport[Pipe_BytesInPipe()];
+ /* Check if data has been received from the attached mouse */
+ if (Pipe_IsReadWriteAllowed())
+ {
+ /* Create buffer big enough for the report */
+ uint8_t MouseReport[Pipe_BytesInPipe()];
- /* Load in the mouse report */
- Pipe_Read_Stream_LE(MouseReport, Pipe_BytesInPipe());
+ /* Load in the mouse report */
+ Pipe_Read_Stream_LE(MouseReport, Pipe_BytesInPipe());
- /* Clear the IN endpoint, ready for next data packet */
- Pipe_ClearCurrentBank();
-
- /* Check each HID report item in turn, looking for mouse X/Y/button reports */
- for (uint8_t ReportNumber = 0; ReportNumber < HIDReportInfo.TotalReportItems; ReportNumber++)
- {
- /* Create a temporary item pointer to the next report item */
- HID_ReportItem_t* ReportItem = &HIDReportInfo.ReportItems[ReportNumber];
-
- bool FoundData;
-
- if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) &&
- (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
- {
- /* Get the mouse button value */
- FoundData = GetReportItemInfo(MouseReport, ReportItem);
-
- /* For multi-report devices - if the requested data was not in the issued report, continue */
- if (!(FoundData))
- continue;
-
- /* If button is pressed, all LEDs are turned on */
- if (ReportItem->Value)
- LEDMask = LEDS_ALL_LEDS;
- }
- else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) &&
- ((ReportItem->Attributes.Usage.Usage == USAGE_X) ||
- (ReportItem->Attributes.Usage.Usage == USAGE_Y)) &&
- (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
- {
- /* Get the mouse relative position value */
- FoundData = GetReportItemInfo(MouseReport, ReportItem);
-
- /* For multi-report devices - if the requested data was not in the issued report, continue */
- if (!(FoundData))
- continue;
-
- int16_t DeltaMovement;
-
- if (ReportItem->Attributes.BitSize > 8)
- DeltaMovement = (int16_t)ReportItem->Value;
- else
- DeltaMovement = (int8_t)ReportItem->Value;
-
- /* Determine if the report is for the X or Y delta movement */
- if (ReportItem->Attributes.Usage.Usage == USAGE_X)
- {
- /* Turn on the appropriate LED according to direction if the delta is non-zero */
- if (DeltaMovement)
- LEDMask |= ((DeltaMovement > 0) ? LEDS_LED1 : LEDS_LED2);
- }
- else
- {
- /* Turn on the appropriate LED according to direction if the delta is non-zero */
- if (DeltaMovement)
- LEDMask |= ((DeltaMovement > 0) ? LEDS_LED3 : LEDS_LED4);
- }
- }
+ /* Process the read in mouse report from the device */
+ ProcessMouseReport(MouseReport);
}
- /* Display the button information on the board LEDs */
- LEDs_SetAllLEDs(LEDMask);
+ /* Clear the IN endpoint, ready for next data packet */
+ Pipe_ClearIN();
}
/* Freeze mouse data pipe */
@@ -352,3 +291,72 @@ TASK(USB_Mouse_Host)
}
}
+/** Processes a read HID report from an attached mouse, extracting out elements via the HID parser results
+ * as required and displays movement and button presses on the board LEDs.
+ *
+ * \param MouseReport Pointer to a HID report from an attached mouse device
+ */
+void ProcessMouseReport(uint8_t* MouseReport)
+{
+ uint8_t LEDMask = LEDS_NO_LEDS;
+
+ /* Check each HID report item in turn, looking for mouse X/Y/button reports */
+ for (uint8_t ReportNumber = 0; ReportNumber < HIDReportInfo.TotalReportItems; ReportNumber++)
+ {
+ /* Create a temporary item pointer to the next report item */
+ HID_ReportItem_t* ReportItem = &HIDReportInfo.ReportItems[ReportNumber];
+
+ bool FoundData;
+
+ if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) &&
+ (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
+ {
+ /* Get the mouse button value */
+ FoundData = GetReportItemInfo(MouseReport, ReportItem);
+
+ /* For multi-report devices - if the requested data was not in the issued report, continue */
+ if (!(FoundData))
+ continue;
+
+ /* If button is pressed, all LEDs are turned on */
+ if (ReportItem->Value)
+ LEDMask = LEDS_ALL_LEDS;
+ }
+ else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) &&
+ ((ReportItem->Attributes.Usage.Usage == USAGE_X) ||
+ (ReportItem->Attributes.Usage.Usage == USAGE_Y)) &&
+ (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
+ {
+ /* Get the mouse relative position value */
+ FoundData = GetReportItemInfo(MouseReport, ReportItem);
+
+ /* For multi-report devices - if the requested data was not in the issued report, continue */
+ if (!(FoundData))
+ continue;
+
+ int16_t DeltaMovement;
+
+ if (ReportItem->Attributes.BitSize > 8)
+ DeltaMovement = (int16_t)ReportItem->Value;
+ else
+ DeltaMovement = (int8_t)ReportItem->Value;
+
+ /* Determine if the report is for the X or Y delta movement */
+ if (ReportItem->Attributes.Usage.Usage == USAGE_X)
+ {
+ /* Turn on the appropriate LED according to direction if the delta is non-zero */
+ if (DeltaMovement)
+ LEDMask |= ((DeltaMovement > 0) ? LEDS_LED1 : LEDS_LED2);
+ }
+ else
+ {
+ /* Turn on the appropriate LED according to direction if the delta is non-zero */
+ if (DeltaMovement)
+ LEDMask |= ((DeltaMovement > 0) ? LEDS_LED3 : LEDS_LED4);
+ }
+ }
+ }
+
+ /* Display the button information on the board LEDs */
+ LEDs_SetAllLEDs(LEDMask);
+} \ No newline at end of file
diff --git a/Demos/Host/MouseHostWithParser/MouseHostWithParser.h b/Demos/Host/MouseHostWithParser/MouseHostWithParser.h
index b59ab9a78..f808745d7 100644
--- a/Demos/Host/MouseHostWithParser/MouseHostWithParser.h
+++ b/Demos/Host/MouseHostWithParser/MouseHostWithParser.h
@@ -39,7 +39,6 @@
#include <stdio.h>
#include <LUFA/Version.h> // Library Version Information
- #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
#include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
#include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // Serial stream driver
@@ -77,5 +76,6 @@
/* Function Prototypes: */
void UpdateStatus(uint8_t CurrentStatus);
-
+ void ProcessMouseReport(uint8_t* MouseReport);
+
#endif
diff --git a/Demos/Host/StillImageHost/ConfigDescriptor.h b/Demos/Host/StillImageHost/ConfigDescriptor.h
index f791488b1..cb4de5f46 100644
--- a/Demos/Host/StillImageHost/ConfigDescriptor.h
+++ b/Demos/Host/StillImageHost/ConfigDescriptor.h
@@ -38,7 +38,6 @@
/* Includes: */
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
- #include <LUFA/Drivers/USB/Class/ConfigDescriptor.h> // Configuration Descriptor Parser
#include "StillImageHost.h"
diff --git a/Demos/Host/StillImageHost/StillImageCommands.c b/Demos/Host/StillImageHost/StillImageCommands.c
index 43e57e126..ebf20b0b2 100644
--- a/Demos/Host/StillImageHost/StillImageCommands.c
+++ b/Demos/Host/StillImageHost/StillImageCommands.c
@@ -72,7 +72,7 @@ void SImage_SendBlockHeader(void)
}
/* Send the PIMA command block to the attached device */
- Pipe_ClearCurrentBank();
+ Pipe_ClearOUT();
}
/* Freeze pipe after use */
@@ -90,7 +90,7 @@ void SImage_RecieveEventHeader(void)
Pipe_Read_Stream_LE(&PIMA_EventBlock, sizeof(PIMA_EventBlock));
/* Clear the pipe after read complete to prepare for next event */
- Pipe_ClearCurrentBank();
+ Pipe_ClearIN();
/* Freeze the event pipe again after use */
Pipe_Freeze();
@@ -106,7 +106,7 @@ uint8_t SImage_RecieveBlockHeader(void)
Pipe_Unfreeze();
/* Wait until data received on the IN pipe */
- while (!(Pipe_ReadWriteAllowed()))
+ while (!(Pipe_IsReadWriteAllowed()))
{
/* Check to see if a new frame has been issued (1ms elapsed) */
if (USB_INT_HasOccurred(USB_INT_HSOFI))
@@ -179,7 +179,7 @@ uint8_t SImage_RecieveBlockHeader(void)
}
/* Clear pipe bank after use */
- Pipe_ClearCurrentBank();
+ Pipe_ClearIN();
}
/* Freeze the IN pipe after use */
@@ -203,7 +203,7 @@ void SImage_SendData(void* Buffer, uint16_t Bytes)
Pipe_Write_Stream_LE(Buffer, Bytes);
/* Send the last packet to the attached device */
- Pipe_ClearCurrentBank();
+ Pipe_ClearOUT();
/* Freeze the pipe again after use */
Pipe_Freeze();
diff --git a/Demos/Host/StillImageHost/StillImageHost.c b/Demos/Host/StillImageHost/StillImageHost.c
index 1694322ee..d9dd7ce3f 100644
--- a/Demos/Host/StillImageHost/StillImageHost.c
+++ b/Demos/Host/StillImageHost/StillImageHost.c
@@ -36,11 +36,6 @@
#include "StillImageHost.h"
-/* Project Tags, for reading out using the ButtLoad project */
-BUTTLOADTAG(ProjName, "LUFA SIMG Host App");
-BUTTLOADTAG(BuildTime, __TIME__);
-BUTTLOADTAG(BuildDate, __DATE__);
-
/* Scheduler Task List */
TASK_LIST
{
@@ -243,7 +238,7 @@ TASK(USB_SImage_Host)
SImage_ReadData(DeviceInfo, DeviceInfoSize);
/* Once all the data has been read, the pipe must be cleared before the response can be sent */
- Pipe_ClearCurrentBank();
+ Pipe_ClearIN();
/* Create a pointer for walking through the info dataset */
uint8_t* DeviceInfoPos = DeviceInfo;
diff --git a/Demos/Host/StillImageHost/StillImageHost.h b/Demos/Host/StillImageHost/StillImageHost.h
index 7757b0807..e4d2e85f8 100644
--- a/Demos/Host/StillImageHost/StillImageHost.h
+++ b/Demos/Host/StillImageHost/StillImageHost.h
@@ -46,7 +46,6 @@
#include "PIMACodes.h"
#include "StillImageCommands.h"
- #include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
#include <LUFA/Drivers/Misc/TerminalCodes.h> // ANSI Terminal Escape Codes
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
#include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // Serial stream driver