Clean up excessive whitespace at the end of each line using the wspurify tool made by Laszlo Monda
This commit is contained in:
parent
a8871c7fba
commit
5a4def7478
760 changed files with 12883 additions and 12164 deletions
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2010.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
|
@ -9,13 +9,13 @@
|
|||
/*
|
||||
Copyright 2010 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
|
||||
|
@ -33,25 +33,25 @@
|
|||
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
||||
{
|
||||
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
|
||||
|
||||
|
||||
USBSpecification: VERSION_BCD(01.10),
|
||||
Class: 0x00,
|
||||
SubClass: 0x00,
|
||||
Protocol: 0x00,
|
||||
|
||||
|
||||
Endpoint0Size: 8,
|
||||
|
||||
|
||||
VendorID: 0x03EB,
|
||||
ProductID: 0x2040,
|
||||
ReleaseNumber: VERSION_BCD(00.01),
|
||||
|
||||
|
||||
ManufacturerStrIndex: 0x01,
|
||||
ProductStrIndex: 0x02,
|
||||
SerialNumStrIndex: 0x03,
|
||||
|
||||
|
||||
NumberOfConfigurations: 1
|
||||
};
|
||||
|
||||
|
||||
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
||||
{
|
||||
.Config =
|
||||
|
@ -60,28 +60,28 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||
|
||||
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
|
||||
TotalInterfaces: 1,
|
||||
|
||||
|
||||
ConfigurationNumber: 1,
|
||||
ConfigurationStrIndex: NO_DESCRIPTOR,
|
||||
|
||||
|
||||
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
||||
|
||||
|
||||
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
|
||||
},
|
||||
|
||||
|
||||
.SSHOW_Interface =
|
||||
{
|
||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
||||
|
||||
InterfaceNumber: 0,
|
||||
AlternateSetting: 0,
|
||||
|
||||
|
||||
TotalEndpoints: 2,
|
||||
|
||||
|
||||
Class: 0xFF,
|
||||
SubClass: 0x00,
|
||||
Protocol: 0x00,
|
||||
|
||||
|
||||
InterfaceStrIndex: NO_DESCRIPTOR
|
||||
},
|
||||
|
||||
|
@ -109,35 +109,35 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||
USB_Descriptor_String_t PROGMEM LanguageString =
|
||||
{
|
||||
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
|
||||
|
||||
|
||||
UnicodeString: {LANGUAGE_ID_ENG}
|
||||
};
|
||||
|
||||
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
||||
{
|
||||
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
|
||||
|
||||
|
||||
UnicodeString: L"Dean Camera"
|
||||
};
|
||||
|
||||
USB_Descriptor_String_t PROGMEM ProductString =
|
||||
{
|
||||
Header: {Size: USB_STRING_LEN(22), Type: DTYPE_String},
|
||||
|
||||
|
||||
UnicodeString: L"LUFA Sideshow Demo"
|
||||
};
|
||||
|
||||
USB_Descriptor_String_t PROGMEM SerialNumberString =
|
||||
{
|
||||
Header: {Size: USB_STRING_LEN(12), Type: DTYPE_String},
|
||||
|
||||
|
||||
UnicodeString: L"000000000000"
|
||||
};
|
||||
|
||||
USB_OSDescriptor_t PROGMEM OSDescriptorString =
|
||||
{
|
||||
Header: {Size: sizeof(USB_OSDescriptor_t), Type: DTYPE_String},
|
||||
|
||||
|
||||
Signature: L"MSFT100",
|
||||
VendorCode: REQ_GetOSFeatureDescriptor
|
||||
};
|
||||
|
@ -148,7 +148,7 @@ USB_OSCompatibleIDDescriptor_t PROGMEM DevCompatIDs =
|
|||
Version: 0x0100,
|
||||
Index: EXTENDED_COMPAT_ID_DESCRIPTOR,
|
||||
TotalSections: 1,
|
||||
|
||||
|
||||
SideshowCompatID: {FirstInterfaceNumber: 0x00,
|
||||
CompatibleID: "SIDESHW",
|
||||
SubCompatibleID: "UNIV1"}
|
||||
|
@ -201,11 +201,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
|||
Size = pgm_read_byte(&OSDescriptorString.Header.Size);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
*DescriptorAddress = Address;
|
||||
|
||||
*DescriptorAddress = Address;
|
||||
return Size;
|
||||
}
|
||||
|
||||
|
@ -230,3 +230,4 @@ uint16_t USB_GetOSFeatureDescriptor(const uint16_t wValue,
|
|||
*DescriptorAddress = Address;
|
||||
return Size;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2010.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
|
@ -9,13 +9,13 @@
|
|||
/*
|
||||
Copyright 2010 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
|
||||
|
@ -35,14 +35,14 @@
|
|||
#include <LUFA/Drivers/USB/USB.h>
|
||||
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
|
||||
#include "Sideshow.h"
|
||||
|
||||
/* Macros: */
|
||||
#define SIDESHOW_IN_EPNUM 3
|
||||
#define SIDESHOW_OUT_EPNUM 4
|
||||
#define SIDESHOW_IN_EPNUM 3
|
||||
#define SIDESHOW_OUT_EPNUM 4
|
||||
#define SIDESHOW_IO_EPSIZE 64
|
||||
|
||||
|
||||
/* Type Defines: */
|
||||
typedef struct
|
||||
{
|
||||
|
@ -51,36 +51,36 @@
|
|||
USB_Descriptor_Endpoint_t SSHOW_DataInEndpoint;
|
||||
USB_Descriptor_Endpoint_t SSHOW_DataOutEndpoint;
|
||||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
USB_Descriptor_Header_t Header;
|
||||
|
||||
|
||||
int Signature[7];
|
||||
uint16_t VendorCode;
|
||||
} USB_OSDescriptor_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t FirstInterfaceNumber;
|
||||
|
||||
uint8_t Reserved;
|
||||
|
||||
|
||||
uint8_t CompatibleID[8];
|
||||
uint8_t SubCompatibleID[8];
|
||||
uint8_t SubCompatibleID[8];
|
||||
|
||||
uint8_t Reserved2[6];
|
||||
} USB_OSCompatibleSection_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t TotalLength;
|
||||
uint16_t Version;
|
||||
uint16_t Index;
|
||||
uint8_t TotalSections;
|
||||
|
||||
|
||||
uint8_t Reserved[7];
|
||||
|
||||
|
||||
USB_OSCompatibleSection_t SideshowCompatID;
|
||||
} USB_OSCompatibleIDDescriptor_t;
|
||||
|
||||
|
@ -96,3 +96,4 @@
|
|||
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2010.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
|
@ -9,13 +9,13 @@
|
|||
/*
|
||||
Copyright 2010 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
|
||||
|
@ -40,7 +40,7 @@ SideShow_Application_t* SideShow_GetFreeApplication(void)
|
|||
if (!(InstalledApplications[App].InUse))
|
||||
return &InstalledApplications[App];
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -54,6 +54,7 @@ SideShow_Application_t* SideShow_GetApplicationFromGUID(GUID_t* const GUID)
|
|||
return &InstalledApplications[App];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2010.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
|
@ -9,13 +9,13 @@
|
|||
/*
|
||||
Copyright 2010 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
|
||||
|
@ -32,10 +32,10 @@
|
|||
#define _SIDESHOW_APPLICATIONS_H_
|
||||
|
||||
/* Includes: */
|
||||
#include <avr/io.h>
|
||||
#include <avr/io.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
|
||||
#include "SideshowCommon.h"
|
||||
|
||||
/* Type Defines: */
|
||||
|
@ -51,12 +51,13 @@
|
|||
uint32_t CurrentContentID;
|
||||
uint8_t CurrentContent[MAX_CONTENTBUFFER_PER_APP];
|
||||
} SideShow_Application_t;
|
||||
|
||||
|
||||
/* External Variables: */
|
||||
extern SideShow_Application_t InstalledApplications[MAX_APPLICATIONS];
|
||||
|
||||
|
||||
/* Function Prototypes: */
|
||||
SideShow_Application_t* SideShow_GetFreeApplication(void);
|
||||
SideShow_Application_t* SideShow_GetApplicationFromGUID(GUID_t* const GUID);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2010.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
|
@ -9,13 +9,13 @@
|
|||
/*
|
||||
Copyright 2010 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
|
||||
|
@ -42,14 +42,14 @@ Unicode_String_t Manufacturer = {LengthInBytes: sizeof(L"Dean Camera"),
|
|||
|
||||
Unicode_String_t SupportedLanguage = {LengthInBytes: sizeof(L"en-US:1"),
|
||||
UnicodeString: L"en-US:1"};
|
||||
|
||||
|
||||
void Sideshow_ProcessCommandPacket(void)
|
||||
{
|
||||
SideShow_PacketHeader_t PacketHeader;
|
||||
|
||||
Endpoint_SelectEndpoint(SIDESHOW_OUT_EPNUM);
|
||||
|
||||
Endpoint_SelectEndpoint(SIDESHOW_OUT_EPNUM);
|
||||
Endpoint_Read_Stream_LE(&PacketHeader, sizeof(SideShow_PacketHeader_t));
|
||||
|
||||
|
||||
PacketHeader.Type.TypeFields.Response = true;
|
||||
|
||||
printf("\r\nCmd: %lX", (PacketHeader.Type.TypeLong & 0x00FFFFFF));
|
||||
|
@ -70,7 +70,7 @@ void Sideshow_ProcessCommandPacket(void)
|
|||
break;
|
||||
case SIDESHOW_CMD_GET_CAPABILITIES:
|
||||
SideShow_GetCapabilities(&PacketHeader);
|
||||
break;
|
||||
break;
|
||||
case SIDESHOW_CMD_GET_DEVICE_NAME:
|
||||
SideShow_GetString(&PacketHeader, &DeviceName);
|
||||
break;
|
||||
|
@ -94,7 +94,7 @@ void Sideshow_ProcessCommandPacket(void)
|
|||
break;
|
||||
case SIDESHOW_CMD_DELETE_ALL_CONTENT:
|
||||
SideShow_DeleteAllContent(&PacketHeader);
|
||||
break;
|
||||
break;
|
||||
case SIDESHOW_CMD_DELETE_APPLICATION:
|
||||
SideShow_DeleteApplication(&PacketHeader);
|
||||
break;
|
||||
|
@ -109,11 +109,11 @@ void Sideshow_ProcessCommandPacket(void)
|
|||
|
||||
PacketHeader.Length = sizeof(SideShow_PacketHeader_t);
|
||||
PacketHeader.Type.TypeFields.NAK = true;
|
||||
|
||||
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
|
||||
Endpoint_Write_Stream_LE(&PacketHeader, sizeof(SideShow_PacketHeader_t));
|
||||
|
||||
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
|
||||
Endpoint_Write_Stream_LE(&PacketHeader, sizeof(SideShow_PacketHeader_t));
|
||||
Endpoint_ClearIN();
|
||||
|
||||
|
||||
printf(" UNK");
|
||||
}
|
||||
}
|
||||
|
@ -122,8 +122,8 @@ static void SideShow_Ping(SideShow_PacketHeader_t* const PacketHeader)
|
|||
{
|
||||
Endpoint_ClearOUT();
|
||||
|
||||
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
|
||||
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
|
||||
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
|
||||
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
|
||||
Endpoint_ClearIN();
|
||||
}
|
||||
|
||||
|
@ -133,12 +133,12 @@ static void SideShow_Sync(SideShow_PacketHeader_t* const PacketHeader)
|
|||
|
||||
Endpoint_Read_Stream_LE(&ProtocolGUID, sizeof(GUID_t));
|
||||
Endpoint_ClearOUT();
|
||||
|
||||
|
||||
if (!(GUID_COMPARE(&ProtocolGUID, (uint32_t[])STANDARD_PROTOCOL_GUID)))
|
||||
PacketHeader->Type.TypeFields.NAK = true;
|
||||
|
||||
|
||||
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
|
||||
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
|
||||
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
|
||||
Endpoint_Write_Stream_LE(&ProtocolGUID, sizeof(GUID_t));
|
||||
Endpoint_ClearIN();
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ static void SideShow_SetCurrentUser(SideShow_PacketHeader_t* const PacketHeader)
|
|||
{
|
||||
SideShow_Read_Unicode_String(&UserSID, sizeof(UserSID.UnicodeString));
|
||||
Endpoint_ClearOUT();
|
||||
|
||||
|
||||
PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
|
||||
|
||||
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
|
||||
|
@ -174,7 +174,7 @@ static void SideShow_GetCapabilities(SideShow_PacketHeader_t* const PacketHeader
|
|||
|
||||
Endpoint_Read_Stream_LE(&Property, sizeof(SideShow_PropertyKey_t));
|
||||
Endpoint_ClearOUT();
|
||||
|
||||
|
||||
printf(" ID: %lu", Property.PropertyID);
|
||||
|
||||
PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
|
||||
|
@ -187,46 +187,46 @@ static void SideShow_GetCapabilities(SideShow_PacketHeader_t* const PacketHeader
|
|||
PropertyData.DataType = VT_I4;
|
||||
PropertyData.Data.Data32 = ScreenText;
|
||||
PacketHeader->Length += sizeof(uint32_t);
|
||||
|
||||
|
||||
break;
|
||||
case PROPERTY_SIDESHOW_SCREENWIDTH:
|
||||
case PROPERTY_SIDESHOW_CLIENTWIDTH:
|
||||
PropertyData.DataType = VT_UI2;
|
||||
PropertyData.Data.Data16 = 16;
|
||||
PacketHeader->Length += sizeof(uint16_t);
|
||||
|
||||
|
||||
break;
|
||||
case PROPERTY_SIDESHOW_SCREENHEIGHT:
|
||||
case PROPERTY_SIDESHOW_CLIENTHEIGHT:
|
||||
PropertyData.DataType = VT_UI2;
|
||||
PropertyData.Data.Data16 = 2;
|
||||
PacketHeader->Length += sizeof(uint16_t);
|
||||
|
||||
|
||||
break;
|
||||
case PROPERTY_SIDESHOW_COLORDEPTH:
|
||||
PropertyData.DataType = VT_UI2;
|
||||
PropertyData.Data.Data16 = 1;
|
||||
PacketHeader->Length += sizeof(uint16_t);
|
||||
|
||||
|
||||
break;
|
||||
case PROPERTY_SIDESHOW_COLORTYPE:
|
||||
PropertyData.DataType = VT_UI2;
|
||||
PropertyData.Data.Data16 = BlackAndWhiteDisplay;
|
||||
PacketHeader->Length += sizeof(uint16_t);
|
||||
|
||||
|
||||
break;
|
||||
case PROPERTY_SIDESHOW_DATACACHE:
|
||||
PropertyData.DataType = VT_BOOL;
|
||||
PropertyData.Data.Data16 = false;
|
||||
PacketHeader->Length += sizeof(uint16_t);
|
||||
|
||||
|
||||
break;
|
||||
case PROPERTY_SIDESHOW_SUPPORTEDLANGS:
|
||||
case PROPERTY_SIDESHOW_CURRENTLANG:
|
||||
PropertyData.DataType = VT_LPWSTR;
|
||||
PropertyData.Data.DataPointer = &SupportedLanguage;
|
||||
PacketHeader->Length += SupportedLanguage.LengthInBytes;
|
||||
|
||||
|
||||
break;
|
||||
default:
|
||||
PropertyData.DataType = VT_EMPTY;
|
||||
|
@ -241,22 +241,22 @@ static void SideShow_GetCapabilities(SideShow_PacketHeader_t* const PacketHeader
|
|||
PropertyData.DataType = VT_UI4;
|
||||
PropertyData.Data.Data32 = GenericDevice;
|
||||
PacketHeader->Length += sizeof(uint32_t);
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PacketHeader->Type.TypeFields.NAK = true;
|
||||
|
||||
PacketHeader->Type.TypeFields.NAK = true;
|
||||
|
||||
printf(" WRONG GUID");
|
||||
printf(" %lX %lX %lX %lX", Property.PropertyGUID.Chunks[0], Property.PropertyGUID.Chunks[1],
|
||||
Property.PropertyGUID.Chunks[2], Property.PropertyGUID.Chunks[3]);
|
||||
Property.PropertyGUID.Chunks[2], Property.PropertyGUID.Chunks[3]);
|
||||
}
|
||||
|
||||
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
|
||||
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
|
||||
|
||||
|
||||
if (!(PacketHeader->Type.TypeFields.NAK))
|
||||
{
|
||||
switch (PropertyData.DataType)
|
||||
|
@ -275,7 +275,7 @@ static void SideShow_GetCapabilities(SideShow_PacketHeader_t* const PacketHeader
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Endpoint_ClearIN();
|
||||
return;
|
||||
}
|
||||
|
@ -287,7 +287,7 @@ static void SideShow_GetString(SideShow_PacketHeader_t* const PacketHeader,
|
|||
|
||||
PacketHeader->Length = sizeof(SideShow_PacketHeader_t) +
|
||||
sizeof(uint32_t) + ((Unicode_String_t*)UnicodeStruct)->LengthInBytes;
|
||||
|
||||
|
||||
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
|
||||
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
|
||||
SideShow_Write_Unicode_String(UnicodeStruct);
|
||||
|
@ -297,7 +297,7 @@ static void SideShow_GetString(SideShow_PacketHeader_t* const PacketHeader,
|
|||
static void SideShow_GetApplicationOrder(SideShow_PacketHeader_t* const PacketHeader)
|
||||
{
|
||||
uint8_t TotalApplications = 0;
|
||||
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
|
||||
for (uint8_t App = 0; App < MAX_APPLICATIONS; App++)
|
||||
|
@ -308,11 +308,11 @@ static void SideShow_GetApplicationOrder(SideShow_PacketHeader_t* const PacketHe
|
|||
|
||||
PacketHeader->Length = sizeof(SideShow_PacketHeader_t) +
|
||||
sizeof(uint32_t) + (TotalApplications * sizeof(GUID_t));
|
||||
|
||||
|
||||
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
|
||||
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
|
||||
Endpoint_Write_DWord_LE(TotalApplications);
|
||||
|
||||
|
||||
for (uint8_t App = 0; App < MAX_APPLICATIONS; App++)
|
||||
{
|
||||
if (InstalledApplications[App].InUse)
|
||||
|
@ -329,7 +329,7 @@ static void SideShow_GetSupportedEndpoints(SideShow_PacketHeader_t* const Packet
|
|||
Endpoint_ClearOUT();
|
||||
|
||||
PacketHeader->Length = sizeof(SideShow_PacketHeader_t) + sizeof(uint32_t) + sizeof(GUID_t);
|
||||
|
||||
|
||||
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
|
||||
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
|
||||
Endpoint_Write_DWord_LE(1);
|
||||
|
@ -369,7 +369,7 @@ static void SideShow_AddApplication(SideShow_PacketHeader_t* const PacketHeader)
|
|||
SideShow_Discard_Byte_Stream();
|
||||
SideShow_Discard_Byte_Stream();
|
||||
Endpoint_ClearOUT();
|
||||
|
||||
|
||||
CurrApp->InUse = true;
|
||||
CurrApp->HaveContent = false;
|
||||
CurrApp->CurrentContentID = 1;
|
||||
|
@ -385,8 +385,8 @@ static void SideShow_AddApplication(SideShow_PacketHeader_t* const PacketHeader)
|
|||
static void SideShow_DeleteApplication(SideShow_PacketHeader_t* const PacketHeader)
|
||||
{
|
||||
GUID_t ApplicationGUID;
|
||||
|
||||
Endpoint_Read_Stream_LE(&ApplicationGUID, sizeof(GUID_t));
|
||||
|
||||
Endpoint_Read_Stream_LE(&ApplicationGUID, sizeof(GUID_t));
|
||||
Endpoint_ClearOUT();
|
||||
|
||||
SideShow_Application_t* AppToDelete = SideShow_GetApplicationFromGUID(&ApplicationGUID);
|
||||
|
@ -406,7 +406,7 @@ static void SideShow_DeleteApplication(SideShow_PacketHeader_t* const PacketHead
|
|||
static void SideShow_DeleteAllApplications(SideShow_PacketHeader_t* const PacketHeader)
|
||||
{
|
||||
Endpoint_ClearOUT();
|
||||
|
||||
|
||||
for (uint8_t App = 0; App < MAX_APPLICATIONS; App++)
|
||||
InstalledApplications[App].InUse = false;
|
||||
|
||||
|
@ -420,12 +420,12 @@ static void SideShow_AddContent(SideShow_PacketHeader_t* const PacketHeader)
|
|||
GUID_t ApplicationID;
|
||||
GUID_t EndpointID;
|
||||
SideShow_Application_t* Application;
|
||||
|
||||
|
||||
Endpoint_Read_Stream_LE(&ApplicationID, sizeof(GUID_t));
|
||||
Endpoint_Read_Stream_LE(&EndpointID, sizeof(GUID_t));
|
||||
|
||||
|
||||
Application = SideShow_GetApplicationFromGUID(&ApplicationID);
|
||||
|
||||
|
||||
if (Application == NULL)
|
||||
{
|
||||
SideShow_Discard_Byte_Stream();
|
||||
|
@ -435,7 +435,7 @@ static void SideShow_AddContent(SideShow_PacketHeader_t* const PacketHeader)
|
|||
{
|
||||
PacketHeader->Type.TypeFields.NAK = true;
|
||||
}
|
||||
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
|
||||
PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
|
||||
|
@ -455,14 +455,14 @@ static void SideShow_DeleteContent(SideShow_PacketHeader_t* const PacketHeader)
|
|||
Endpoint_Read_Stream_LE(&EndpointID, sizeof(GUID_t));
|
||||
Endpoint_Read_Stream_LE(&ContentID, sizeof(uint32_t));
|
||||
Endpoint_ClearOUT();
|
||||
|
||||
|
||||
SideShow_Application_t* Application = SideShow_GetApplicationFromGUID(&ApplicationID);
|
||||
|
||||
|
||||
if ((Application != NULL) && (Application->CurrentContentID == ContentID))
|
||||
Application->HaveContent = false;
|
||||
else
|
||||
PacketHeader->Type.TypeFields.NAK = true;
|
||||
|
||||
|
||||
PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
|
||||
|
||||
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
|
||||
|
@ -480,15 +480,16 @@ static void SideShow_DeleteAllContent(SideShow_PacketHeader_t* const PacketHeade
|
|||
Endpoint_ClearOUT();
|
||||
|
||||
SideShow_Application_t* Application = SideShow_GetApplicationFromGUID(&ApplicationID);
|
||||
|
||||
|
||||
if (Application != NULL)
|
||||
Application->HaveContent = false;
|
||||
else
|
||||
PacketHeader->Type.TypeFields.NAK = true;
|
||||
PacketHeader->Type.TypeFields.NAK = true;
|
||||
|
||||
PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
|
||||
|
||||
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
|
||||
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
|
||||
Endpoint_ClearIN();
|
||||
Endpoint_ClearIN();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2010.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
|
@ -9,13 +9,13 @@
|
|||
/*
|
||||
Copyright 2010 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
|
||||
|
@ -35,7 +35,7 @@
|
|||
#include <avr/io.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#include "Sideshow.h"
|
||||
#include "SideshowCommon.h"
|
||||
#include "SideshowApplications.h"
|
||||
|
@ -63,25 +63,25 @@
|
|||
VT_UI4 = 19,
|
||||
VT_LPWSTR = 31,
|
||||
};
|
||||
|
||||
|
||||
enum SideShow_ScreenTypeText_t
|
||||
{
|
||||
ScreenBitmap = 0,
|
||||
ScreenText = 1,
|
||||
};
|
||||
|
||||
|
||||
enum SideShow_ColorTypes_t
|
||||
{
|
||||
ColorDisplay = 0,
|
||||
GrayscaleDisplay = 1,
|
||||
BlackAndWhiteDisplay = 2,
|
||||
BlackAndWhiteDisplay = 2,
|
||||
};
|
||||
|
||||
enum SideShow_DeviceTypes_t
|
||||
{
|
||||
GenericDevice = 0,
|
||||
CameraDevice = 1,
|
||||
MediaPlayerDevice = 2,
|
||||
{
|
||||
GenericDevice = 0,
|
||||
CameraDevice = 1,
|
||||
MediaPlayerDevice = 2,
|
||||
PhoneDevice = 3,
|
||||
VideoDevice = 4,
|
||||
PIMDevice = 5,
|
||||
|
@ -94,11 +94,11 @@
|
|||
GUID_t PropertyGUID;
|
||||
uint32_t PropertyID;
|
||||
} SideShow_PropertyKey_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t DataType;
|
||||
|
||||
|
||||
union
|
||||
{
|
||||
void* DataPointer;
|
||||
|
@ -107,12 +107,12 @@
|
|||
uint32_t Data32;
|
||||
} Data;
|
||||
} SideShow_PropertyData_t;
|
||||
|
||||
|
||||
/* Macros: */
|
||||
#define SIDESHOW_CMD_PING 0x001
|
||||
#define SIDESHOW_CMD_SET_CURRENT_USER 0x100
|
||||
#define SIDESHOW_CMD_GET_CURRENT_USER 0x101
|
||||
#define SIDESHOW_CMD_GET_CAPABILITIES 0x103
|
||||
#define SIDESHOW_CMD_GET_CAPABILITIES 0x103
|
||||
#define SIDESHOW_CMD_GET_APPLICATION_ORDER 0x104
|
||||
#define SIDESHOW_CMD_ADD_APPLICATION 0x10D
|
||||
#define SIDESHOW_CMD_DELETE_APPLICATION 0x10E
|
||||
|
@ -139,12 +139,12 @@
|
|||
#define PROPERTY_SIDESHOW_CLIENTWIDTH 15
|
||||
#define PROPERTY_SIDESHOW_CLIENTHEIGHT 16
|
||||
#define PROPERTY_SIDESHOW_DEVICEICON 17
|
||||
|
||||
|
||||
#define PROPERTY_DEVICE_DEVICETYPE 15
|
||||
|
||||
|
||||
/* Function Prototypes: */
|
||||
void Sideshow_ProcessCommandPacket(void);
|
||||
|
||||
|
||||
#if defined(INCLUDE_FROM_SIDESHOWCOMMANDS_H)
|
||||
static void SideShow_Ping(SideShow_PacketHeader_t* const PacketHeader);
|
||||
static void SideShow_Sync(SideShow_PacketHeader_t* const PacketHeader);
|
||||
|
@ -164,3 +164,4 @@
|
|||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2010.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
|
@ -9,13 +9,13 @@
|
|||
/*
|
||||
Copyright 2010 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
|
||||
|
@ -35,20 +35,20 @@ uint16_t SideShow_Read_Unicode_String(void* const UnicodeString,
|
|||
{
|
||||
Unicode_String_t* const UnicodeStruct = (Unicode_String_t*)UnicodeString;
|
||||
uint32_t UnicodeCharsToRead;
|
||||
|
||||
|
||||
Endpoint_Read_Stream_LE(&UnicodeCharsToRead, sizeof(uint32_t));
|
||||
|
||||
|
||||
int UnicodeData[UnicodeCharsToRead];
|
||||
|
||||
UnicodeStruct->LengthInBytes = (UnicodeCharsToRead << 1);
|
||||
|
||||
Endpoint_Read_Stream_LE(&UnicodeData, UnicodeStruct->LengthInBytes);
|
||||
|
||||
|
||||
if (UnicodeStruct->LengthInBytes > MaxBytes)
|
||||
UnicodeStruct->LengthInBytes = MaxBytes;
|
||||
|
||||
|
||||
memcpy(&UnicodeStruct->UnicodeString, &UnicodeData, UnicodeStruct->LengthInBytes);
|
||||
|
||||
|
||||
return ((UnicodeCharsToRead << 1) + sizeof(uint32_t));
|
||||
}
|
||||
|
||||
|
@ -69,3 +69,4 @@ void SideShow_Discard_Byte_Stream(void)
|
|||
Endpoint_Read_Stream_LE(&StreamSize, sizeof(uint32_t));
|
||||
Endpoint_Discard_Stream(StreamSize);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2010.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
|
@ -9,13 +9,13 @@
|
|||
/*
|
||||
Copyright 2010 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
|
||||
|
@ -33,15 +33,15 @@
|
|||
|
||||
/* Includes: */
|
||||
#include <avr/io.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <LUFA/Drivers/USB/USB.h>
|
||||
|
||||
/* Macros: */
|
||||
#define GUID_COMPARE(a, b) (memcmp(a, b, sizeof(GUID_t)) == 0)
|
||||
|
||||
|
||||
#define ARRAY_ELEMENTS(x) (sizeof(x) / sizeof(x[0]))
|
||||
|
||||
|
||||
#define UNICODE_STRING_t(x) struct \
|
||||
{ \
|
||||
uint16_t LengthInBytes; \
|
||||
|
@ -67,12 +67,12 @@
|
|||
{
|
||||
uint32_t Chunks[4];
|
||||
} GUID_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t LengthInBytes;
|
||||
int UnicodeString[];
|
||||
} Unicode_String_t;
|
||||
} Unicode_String_t;
|
||||
|
||||
typedef union
|
||||
{
|
||||
|
@ -84,10 +84,10 @@
|
|||
|
||||
int ErrorCode : 6;
|
||||
int NAK : 1;
|
||||
int Response : 1;
|
||||
int Response : 1;
|
||||
} TypeFields;
|
||||
} SideShowPacketType_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Length;
|
||||
|
@ -101,4 +101,4 @@
|
|||
void SideShow_Write_Unicode_String(void* UnicodeString);
|
||||
void SideShow_Discard_Byte_Stream(void);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2010.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
|
@ -9,13 +9,13 @@
|
|||
/*
|
||||
Copyright 2010 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
|
||||
|
@ -36,7 +36,7 @@ bool SideShow_AddSimpleContent(SideShow_PacketHeader_t* const PacketHeader,
|
|||
{
|
||||
uint32_t ContentSize;
|
||||
uint32_t ContentID;
|
||||
|
||||
|
||||
Endpoint_Read_Stream_LE(&ContentID, sizeof(uint32_t));
|
||||
|
||||
PacketHeader->Length -= sizeof(uint32_t);
|
||||
|
@ -47,16 +47,16 @@ bool SideShow_AddSimpleContent(SideShow_PacketHeader_t* const PacketHeader,
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Endpoint_Read_Stream_LE(&ContentSize, sizeof(uint32_t));
|
||||
Endpoint_Read_Stream_LE(&Application->CurrentContent, sizeof(XML_START_TAG) - 1);
|
||||
|
||||
|
||||
PacketHeader->Length -= sizeof(uint32_t) + (sizeof(XML_START_TAG) - 1);
|
||||
|
||||
if (!(memcmp(&Application->CurrentContent, XML_START_TAG, (sizeof(XML_START_TAG) - 1))))
|
||||
{
|
||||
SideShow_ProcessXMLContent(&Application->CurrentContent, (ContentSize - (sizeof(XML_END_TAG) - 1)));
|
||||
|
||||
|
||||
Endpoint_Discard_Stream(sizeof(XML_END_TAG) - 1);
|
||||
|
||||
Application->HaveContent = true;
|
||||
|
@ -66,7 +66,7 @@ bool SideShow_AddSimpleContent(SideShow_PacketHeader_t* const PacketHeader,
|
|||
printf(" BINARY");
|
||||
Endpoint_Discard_Stream(ContentSize);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -76,3 +76,4 @@ static void SideShow_ProcessXMLContent(void* ContentData,
|
|||
printf(" XML");
|
||||
Endpoint_Discard_Stream(ContentSize);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2010.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
|
@ -9,13 +9,13 @@
|
|||
/*
|
||||
Copyright 2010 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
|
||||
|
@ -39,7 +39,7 @@
|
|||
|
||||
#include "SideshowCommon.h"
|
||||
#include "SideshowApplications.h"
|
||||
|
||||
|
||||
/* Enums: */
|
||||
enum SideShow_ContentTypes_t
|
||||
{
|
||||
|
@ -50,24 +50,24 @@
|
|||
Content_Text = 4,
|
||||
Content_EndOfContent = 5
|
||||
};
|
||||
|
||||
|
||||
enum SideShow_ActionTypes_t
|
||||
{
|
||||
TODO
|
||||
};
|
||||
|
||||
|
||||
enum SideShow_AlignmentTypes_t
|
||||
{
|
||||
TODO2
|
||||
};
|
||||
|
||||
|
||||
/* Type Defines: */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t ContentType;
|
||||
uint8_t ContentSize;
|
||||
uint8_t ContentSize;
|
||||
} SideShow_Content_Header_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SideShow_Content_Header_t Header;
|
||||
|
@ -86,7 +86,7 @@
|
|||
bool IsSelected;
|
||||
char Text[];
|
||||
} SideShow_Content_MenuItem_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SideShow_Content_Header_t Header;
|
||||
|
@ -94,7 +94,7 @@
|
|||
uint8_t Key;
|
||||
uint32_t Target;
|
||||
} SideShow_Content_Button_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SideShow_Content_Header_t Header;
|
||||
|
@ -108,13 +108,13 @@
|
|||
{
|
||||
SideShow_Content_Header_t Header;
|
||||
|
||||
char Text[];
|
||||
char Text[];
|
||||
} SideShow_Content_Text_t;
|
||||
|
||||
|
||||
/* Defines: */
|
||||
#define XML_START_TAG "<body>"
|
||||
#define XML_END_TAG "</body>"
|
||||
|
||||
|
||||
/* Function Prototypes: */
|
||||
bool SideShow_AddSimpleContent(SideShow_PacketHeader_t* const PacketHeader,
|
||||
SideShow_Application_t* const Application);
|
||||
|
@ -123,5 +123,5 @@
|
|||
static void SideShow_ProcessXMLContent(void* ContentData,
|
||||
uint32_t ContentSize);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2010.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
|
@ -9,13 +9,13 @@
|
|||
/*
|
||||
Copyright 2010 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
|
||||
|
@ -36,12 +36,12 @@
|
|||
externally connected interactive display. Upon enumeration, this will
|
||||
appear as a new SideShow device which can have gadgets loaded onto
|
||||
it.
|
||||
|
||||
|
||||
Note that while the incoming content is buffered in packet struct
|
||||
form, the data is not actually displayed. It is left to the user to
|
||||
write sufficient code to read out the packed data for display to a
|
||||
screen.
|
||||
|
||||
|
||||
Installed gadgets can be accessed through the InstalledApplications
|
||||
array, with entries that have their InUse flag set being active. As
|
||||
only the active content is displayed on the device due to memory
|
||||
|
@ -59,7 +59,7 @@ int main(void)
|
|||
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
|
||||
sei();
|
||||
|
||||
|
||||
for (;;)
|
||||
{
|
||||
SideShow_Task();
|
||||
|
@ -76,7 +76,7 @@ void SetupHardware(void)
|
|||
|
||||
/* Disable clock division */
|
||||
clock_prescale_set(clock_div_1);
|
||||
|
||||
|
||||
/* Hardware Initialization */
|
||||
LEDs_Init();
|
||||
USB_Init();
|
||||
|
@ -121,9 +121,9 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
|
|||
|
||||
if (DescriptorSize == NO_DESCRIPTOR)
|
||||
return;
|
||||
|
||||
|
||||
Endpoint_ClearSETUP();
|
||||
|
||||
|
||||
Endpoint_Write_Control_PStream_LE(DescriptorPointer, DescriptorSize);
|
||||
Endpoint_ClearOUT();
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SideShow_Task(void)
|
||||
{
|
||||
/* Device must be connected and configured for the task to run */
|
||||
|
@ -140,7 +140,7 @@ void SideShow_Task(void)
|
|||
|
||||
/* Select the SideShow data out endpoint */
|
||||
Endpoint_SelectEndpoint(SIDESHOW_OUT_EPNUM);
|
||||
|
||||
|
||||
/* Check to see if a new SideShow message has been received */
|
||||
if (Endpoint_IsReadWriteAllowed())
|
||||
{
|
||||
|
@ -148,3 +148,4 @@ void SideShow_Task(void)
|
|||
Sideshow_ProcessCommandPacket();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2010.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
|
@ -9,13 +9,13 @@
|
|||
/*
|
||||
Copyright 2010 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
|
||||
|
@ -50,7 +50,7 @@
|
|||
* descriptors of the device.
|
||||
*/
|
||||
#define REQ_GetOSFeatureDescriptor 0x01
|
||||
|
||||
|
||||
/** Descriptor index for a Microsoft Proprietary Extended Device Compatibility descriptor. */
|
||||
#define EXTENDED_COMPAT_ID_DESCRIPTOR 0x0004
|
||||
|
||||
|
@ -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 SideShow_Task(void);
|
||||
|
@ -76,3 +76,4 @@
|
|||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
# make doxygen = Generate DoxyGen documentation for the project (must have
|
||||
# DoxyGen installed)
|
||||
#
|
||||
# make debug = Start either simulavr or avarice as specified for debugging,
|
||||
# make debug = Start either simulavr or avarice as specified for debugging,
|
||||
# with avr-gdb or avr-insight as the front end for debugging.
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only.
|
||||
|
@ -64,14 +64,14 @@ MCU = at90usb1287
|
|||
|
||||
|
||||
# Target board (see library "Board Types" documentation, NONE for projects not requiring
|
||||
# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
|
||||
# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
|
||||
# "Board" inside the application directory.
|
||||
BOARD = USBKEY
|
||||
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
|
@ -84,7 +84,7 @@ F_CPU = 8000000
|
|||
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_CLOCK, in all source code files equal to the
|
||||
# This will define a symbol, F_CLOCK, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
|
@ -141,7 +141,7 @@ SRC = $(TARGET).c \
|
|||
|
||||
|
||||
# List C++ source files here. (C dependencies are automatically generated.)
|
||||
CPPSRC =
|
||||
CPPSRC =
|
||||
|
||||
|
||||
# List Assembler source files here.
|
||||
|
@ -154,7 +154,7 @@ CPPSRC =
|
|||
ASRC =
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
@ -268,7 +268,7 @@ CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
|||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
# -listing-cont-lines: Sets the maximum number of continuation lines of hex
|
||||
# -listing-cont-lines: Sets the maximum number of continuation lines of hex
|
||||
# dump that will be displayed for a given single line of source input.
|
||||
ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
|
||||
|
||||
|
@ -281,7 +281,7 @@ PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
|||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
# If this is left blank, then it will use the Standard printf version.
|
||||
PRINTF_LIB =
|
||||
PRINTF_LIB =
|
||||
#PRINTF_LIB = $(PRINTF_LIB_MIN)
|
||||
#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
|
||||
|
||||
|
@ -293,7 +293,7 @@ SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
|||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
# If this is left blank, then it will use the Standard scanf version.
|
||||
SCANF_LIB =
|
||||
SCANF_LIB =
|
||||
#SCANF_LIB = $(SCANF_LIB_MIN)
|
||||
#SCANF_LIB = $(SCANF_LIB_FLOAT)
|
||||
|
||||
|
@ -305,7 +305,7 @@ MATH_LIB = -lm
|
|||
# Each directory must be seperated by a space.
|
||||
# Use forward slashes for directory separators.
|
||||
# For a directory that has spaces, enclose it in quotes.
|
||||
EXTRALIBDIRS =
|
||||
EXTRALIBDIRS =
|
||||
|
||||
|
||||
|
||||
|
@ -328,7 +328,7 @@ EXTMEMOPTS =
|
|||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += -Wl,--relax
|
||||
LDFLAGS += -Wl,--relax
|
||||
LDFLAGS += -Wl,--gc-sections
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
|
||||
|
@ -362,7 +362,7 @@ AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
|||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
|
@ -396,7 +396,7 @@ JTAG_DEV = /dev/com1
|
|||
DEBUG_PORT = 4242
|
||||
|
||||
# Debugging host used to communicate between GDB / avarice / simulavr, normally
|
||||
# just set to localhost unless doing some sort of crazy debugging when
|
||||
# just set to localhost unless doing some sort of crazy debugging when
|
||||
# avarice is running on a different computer.
|
||||
DEBUG_HOST = localhost
|
||||
|
||||
|
@ -425,7 +425,7 @@ WINSHELL = cmd
|
|||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
|
@ -444,10 +444,10 @@ MSG_CREATING_LIBRARY = Creating library:
|
|||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
|
||||
OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
|
||||
LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
|
@ -512,11 +512,11 @@ sizeafter:
|
|||
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
# Program the device.
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
@ -543,9 +543,9 @@ dfu-ee: $(TARGET).hex $(TARGET).eep
|
|||
|
||||
|
||||
# Generate avr-gdb config/init file which does the following:
|
||||
# define the reset signal, load the target file, connect to target, and set
|
||||
# define the reset signal, load the target file, connect to target, and set
|
||||
# a breakpoint at main().
|
||||
gdb-config:
|
||||
gdb-config:
|
||||
@$(REMOVE) $(GDBINIT_FILE)
|
||||
@echo define reset >> $(GDBINIT_FILE)
|
||||
@echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
|
||||
|
@ -643,14 +643,14 @@ extcoff: $(TARGET).elf
|
|||
$(OBJDIR)/%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create object files from C++ source files.
|
||||
$(OBJDIR)/%.o : %.cpp
|
||||
@echo
|
||||
@echo $(MSG_COMPILING_CPP) $<
|
||||
$(CC) -c $(ALL_CPPFLAGS) $< -o $@
|
||||
$(CC) -c $(ALL_CPPFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
|
@ -672,7 +672,7 @@ $(OBJDIR)/%.o : %.S
|
|||
|
||||
# Create preprocessed source for use in sending a bug report.
|
||||
%.i : %.c
|
||||
$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
|
||||
$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
|
@ -716,3 +716,4 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
|
|||
build elf hex eep lss sym coff extcoff doxygen clean \
|
||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee \
|
||||
debug gdb-config
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue