aboutsummaryrefslogtreecommitdiffstats
path: root/Projects
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-06-19 03:37:47 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-06-19 03:37:47 +0000
commitdfa547164a1f9aefe202041e61075852f6e47191 (patch)
treebf01445acc8cbf41c614ef5a928802fd0ec9eeda /Projects
parent0d8679cf6bf02b3fd07028f63187286f5d4ffc20 (diff)
downloadlufa-dfa547164a1f9aefe202041e61075852f6e47191.tar.gz
lufa-dfa547164a1f9aefe202041e61075852f6e47191.tar.bz2
lufa-dfa547164a1f9aefe202041e61075852f6e47191.zip
Extend USB_GetDeviceConfigDescriptor() routine to require the configuration number within the device to fetch, to add support for multi-configuration devices.
Diffstat (limited to 'Projects')
-rw-r--r--Projects/MissileLauncher/ConfigDescriptor.c4
-rw-r--r--Projects/MissileLauncher/MissileLauncher.c24
2 files changed, 14 insertions, 14 deletions
diff --git a/Projects/MissileLauncher/ConfigDescriptor.c b/Projects/MissileLauncher/ConfigDescriptor.c
index 29fa60ba3..2a6e15256 100644
--- a/Projects/MissileLauncher/ConfigDescriptor.c
+++ b/Projects/MissileLauncher/ConfigDescriptor.c
@@ -53,7 +53,7 @@ uint8_t ProcessConfigurationDescriptor(void)
uint8_t FoundEndpoints = 0;
/* Get Configuration Descriptor size from the device */
- if (USB_GetDeviceConfigDescriptor(&ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)
+ if (USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)
return ControlError;
/* Ensure that the Configuration Descriptor isn't too large */
@@ -64,7 +64,7 @@ uint8_t ProcessConfigurationDescriptor(void)
ConfigDescriptorData = alloca(ConfigDescriptorSize);
/* Retrieve the entire configuration descriptor into the allocated buffer */
- USB_GetDeviceConfigDescriptor(&ConfigDescriptorSize, ConfigDescriptorData);
+ USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, ConfigDescriptorData);
/* Validate returned data - ensure first entry is a configuration header descriptor */
if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)
diff --git a/Projects/MissileLauncher/MissileLauncher.c b/Projects/MissileLauncher/MissileLauncher.c
index 2782b695f..bd542ee45 100644
--- a/Projects/MissileLauncher/MissileLauncher.c
+++ b/Projects/MissileLauncher/MissileLauncher.c
@@ -54,40 +54,40 @@
#include "MissileLauncher.h"
/** Launcher first init command report data sequence */
-static const uint8_t CMD_INITA[8] = { 85, 83, 66, 67, 0, 0, 4, 0 };
+uint8_t CMD_INITA[8] = { 85, 83, 66, 67, 0, 0, 4, 0 };
/** Launcher second init command report data sequence */
-static const uint8_t CMD_INITB[8] = { 85, 83, 66, 67, 0, 64, 2, 0 };
+uint8_t CMD_INITB[8] = { 85, 83, 66, 67, 0, 64, 2, 0 };
/** Launcher command report data sequence to stop all movement */
-static const uint8_t CMD_STOP[8] = { 0, 0, 0, 0, 0, 0, 8, 8 };
+uint8_t CMD_STOP[8] = { 0, 0, 0, 0, 0, 0, 8, 8 };
/** Launcher command report data sequence to move left */
-static const uint8_t CMD_LEFT[8] = { 0, 1, 0, 0, 0, 0, 8, 8 };
+uint8_t CMD_LEFT[8] = { 0, 1, 0, 0, 0, 0, 8, 8 };
/** Launcher command report data sequence to move right */
-static const uint8_t CMD_RIGHT[8] = { 0, 0, 1, 0, 0, 0, 8, 8 };
+uint8_t CMD_RIGHT[8] = { 0, 0, 1, 0, 0, 0, 8, 8 };
/** Launcher command report data sequence to move up */
-static const uint8_t CMD_UP[8] = { 0, 0, 0, 1, 0, 0, 8, 8 };
+uint8_t CMD_UP[8] = { 0, 0, 0, 1, 0, 0, 8, 8 };
/** Launcher command report data sequence to move down */
-static const uint8_t CMD_DOWN[8] = { 0, 0, 0, 0, 1, 0, 8, 8 };
+uint8_t CMD_DOWN[8] = { 0, 0, 0, 0, 1, 0, 8, 8 };
/** Launcher command report data sequence to move left and up */
-static const uint8_t CMD_LEFTUP[8] = { 0, 1, 0, 1, 0, 0, 8, 8 };
+uint8_t CMD_LEFTUP[8] = { 0, 1, 0, 1, 0, 0, 8, 8 };
/** Launcher command report data sequence to move right and up */
-static const uint8_t CMD_RIGHTUP[8] = { 0, 0, 1, 1, 0, 0, 8, 8 };
+uint8_t CMD_RIGHTUP[8] = { 0, 0, 1, 1, 0, 0, 8, 8 };
/** Launcher command report data sequence to move left and down */
-static const uint8_t CMD_LEFTDOWN[8] = { 0, 1, 0, 0, 1, 0, 8, 8 };
+uint8_t CMD_LEFTDOWN[8] = { 0, 1, 0, 0, 1, 0, 8, 8 };
/** Launcher command report data sequence to move right and down */
-static const uint8_t CMD_RIGHTDOWN[8] = { 0, 0, 1, 0, 1, 0, 8, 8 };
+uint8_t CMD_RIGHTDOWN[8] = { 0, 0, 1, 0, 1, 0, 8, 8 };
/** Launcher command report data sequence to fire a missile */
-static const uint8_t CMD_FIRE[8] = { 0, 0, 0, 0, 0, 1, 8, 8 };
+uint8_t CMD_FIRE[8] = { 0, 0, 0, 0, 0, 1, 8, 8 };
/** Last command sent to the launcher, to determine what new command (if any) must be sent */
uint8_t* CmdState;