diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-11-17 10:32:17 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-11-17 10:32:17 +0000 |
commit | 9b2011455585885748164ab76dfaae76fffb0ff9 (patch) | |
tree | 793afb8d681b07fc84582828735e23e90465d7d7 /Demos | |
parent | 79e54580ae0ce192f6c66a11880136eac483fc29 (diff) | |
download | lufa-9b2011455585885748164ab76dfaae76fffb0ff9.tar.gz lufa-9b2011455585885748164ab76dfaae76fffb0ff9.tar.bz2 lufa-9b2011455585885748164ab76dfaae76fffb0ff9.zip |
Make RNDISHost demo validate the set Packet Filter to ensure that it is being sent correctly.
Add new (incomplete) StandaloneProgrammer project, using the ELM Petite FAT library to read files stored on the board's dataflash by the host.
Diffstat (limited to 'Demos')
5 files changed, 24 insertions, 7 deletions
diff --git a/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h b/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h index 3f477ede4..2deac0963 100644 --- a/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h +++ b/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h @@ -42,9 +42,10 @@ #include "MassStorage.h"
#include "Descriptors.h"
- #include <LUFA/Common/Common.h> // Function Attribute, Atomic, Debug and ISR Macros
- #include <LUFA/Drivers/USB/USB.h> // USB Functionality
- #include <LUFA/Drivers/Board/Dataflash.h> // Dataflash chip driver
+ #include <LUFA/Common/Common.h> // Function Attribute, Atomic, Debug and ISR Macros
+ #include <LUFA/Drivers/USB/USB.h> // USB Functionality
+ #include <LUFA/Drivers/USB/Class/MassStorage.h> // Mass Storage Class Driver
+ #include <LUFA/Drivers/Board/Dataflash.h> // Dataflash chip driver
/* Preprocessor Checks: */
#if (DATAFLASH_PAGE_SIZE % 16)
diff --git a/Demos/Device/ClassDriver/MassStorage/MassStorage.h b/Demos/Device/ClassDriver/MassStorage/MassStorage.h index 930e8f4cb..fca288d7c 100644 --- a/Demos/Device/ClassDriver/MassStorage/MassStorage.h +++ b/Demos/Device/ClassDriver/MassStorage/MassStorage.h @@ -47,9 +47,7 @@ #include "Lib/DataflashManager.h"
#include <LUFA/Version.h>
- #include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/LEDs.h>
- #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/MassStorage.h> diff --git a/Demos/Host/Incomplete/RNDISEthernetHost/Lib/RNDISCommands.c b/Demos/Host/Incomplete/RNDISEthernetHost/Lib/RNDISCommands.c index 4802bedb9..b1966142a 100644 --- a/Demos/Host/Incomplete/RNDISEthernetHost/Lib/RNDISCommands.c +++ b/Demos/Host/Incomplete/RNDISEthernetHost/Lib/RNDISCommands.c @@ -72,7 +72,7 @@ uint8_t RNDIS_GetEncapsulatedResponse(void* Buffer, uint16_t Length) return USB_Host_SendControlRequest(Buffer);
}
-uint8_t RNDIS_KeepAlive(void)
+uint8_t RNDIS_SendKeepAlive(void)
{
uint8_t ErrorCode;
diff --git a/Demos/Host/Incomplete/RNDISEthernetHost/Lib/RNDISCommands.h b/Demos/Host/Incomplete/RNDISEthernetHost/Lib/RNDISCommands.h index af3e7cc92..429b4c535 100644 --- a/Demos/Host/Incomplete/RNDISEthernetHost/Lib/RNDISCommands.h +++ b/Demos/Host/Incomplete/RNDISEthernetHost/Lib/RNDISCommands.h @@ -203,7 +203,7 @@ uint8_t RNDIS_SendEncapsulatedCommand(void* Buffer, uint16_t Length);
uint8_t RNDIS_GetEncapsulatedResponse(void* Buffer, uint16_t Length);
- uint8_t RNDIS_KeepAlive(void);
+ uint8_t RNDIS_SendKeepAlive(void);
uint8_t RNDIS_InitializeDevice(uint16_t HostMaxPacketSize, uint16_t* DeviceMaxPacketSize);
uint8_t RNDIS_SetRNDISProperty(uint32_t Oid, void* Buffer, uint16_t Length);
uint8_t RNDIS_QueryRNDISProperty(uint32_t Oid, void* Buffer, uint16_t MaxLength);
diff --git a/Demos/Host/Incomplete/RNDISEthernetHost/RNDISEthernetHost.c b/Demos/Host/Incomplete/RNDISEthernetHost/RNDISEthernetHost.c index c84f0c00c..f3252cd87 100644 --- a/Demos/Host/Incomplete/RNDISEthernetHost/RNDISEthernetHost.c +++ b/Demos/Host/Incomplete/RNDISEthernetHost/RNDISEthernetHost.c @@ -247,6 +247,24 @@ void RNDIS_Host_Task(void) break;
}
+ uint32_t RetrievedPacketFilter;
+ if ((ErrorCode = RNDIS_QueryRNDISProperty(OID_GEN_CURRENT_PACKET_FILTER,
+ &RetrievedPacketFilter, sizeof(RetrievedPacketFilter))) != HOST_SENDCONTROL_Successful)
+ {
+ printf_P(PSTR(ESC_FG_RED "Error Getting Packet Filter.\r\n"
+ " -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);
+
+ /* Indicate error via status LEDs */
+ LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
+
+ /* Wait until USB device disconnected */
+ USB_HostState = HOST_STATE_WaitForDeviceRemoval;
+ break;
+ }
+
+ if (RetrievedPacketFilter != PacketFilter)
+ printf("ERROR: Retrieved Packet Filter %08lx != Set Packet Filter %08lx!\r\n", RetrievedPacketFilter, PacketFilter);
+
uint32_t VendorID;
if ((ErrorCode = RNDIS_QueryRNDISProperty(OID_GEN_VENDOR_ID,
&VendorID, sizeof(VendorID))) != HOST_SENDCONTROL_Successful)
|