tux-droid-svn Mailing List for Tux Droid CE (Page 194)
Status: Beta
Brought to you by:
ks156
You can subscribe to this list here.
2007 |
Jan
|
Feb
(32) |
Mar
(108) |
Apr
(71) |
May
(38) |
Jun
(128) |
Jul
(1) |
Aug
(14) |
Sep
(77) |
Oct
(104) |
Nov
(90) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(81) |
Feb
(18) |
Mar
(40) |
Apr
(102) |
May
(151) |
Jun
(74) |
Jul
(151) |
Aug
(257) |
Sep
(447) |
Oct
(379) |
Nov
(404) |
Dec
(430) |
2009 |
Jan
(173) |
Feb
(236) |
Mar
(519) |
Apr
(300) |
May
(112) |
Jun
(232) |
Jul
(314) |
Aug
(58) |
Sep
(203) |
Oct
(293) |
Nov
(26) |
Dec
(109) |
2010 |
Jan
(19) |
Feb
(25) |
Mar
(33) |
Apr
(1) |
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Paul_R <c2m...@c2...> - 2008-05-21 10:02:16
|
Author: Paul_R Date: 2008-05-21 12:02:01 +0200 (Wed, 21 May 2008) New Revision: 1181 Modified: firmware/fuxusb/trunk/src/usb_desc.h Log: * Commented the descriptors structures Modified: firmware/fuxusb/trunk/src/usb_desc.h =================================================================== --- firmware/fuxusb/trunk/src/usb_desc.h 2008-05-20 20:13:51 UTC (rev 1180) +++ firmware/fuxusb/trunk/src/usb_desc.h 2008-05-21 10:02:01 UTC (rev 1181) @@ -219,271 +219,271 @@ struct usb_st_device_descriptor { - uint8_t bLength; /* Size of this descriptor in bytes */ - uint8_t bDescriptorType; /* DEVICE descriptor type */ - uint16_t bscUSB; /* Binay Coded Decimal Spec. release */ - uint8_t bDeviceClass; /* Class code assigned by the USB */ - uint8_t bDeviceSubClass; /* Sub-class code assigned by the USB */ - uint8_t bDeviceProtocol; /* Protocol code assigned by the USB */ - uint8_t bMaxPacketSize0; /* Max packet size for EP0 */ - uint16_t idVendor; /* Vendor ID. ATMEL = 0x03EB */ - uint16_t idProduct; /* Product ID assigned by the manufacturer */ - uint16_t bcdDevice; /* Device release number */ - uint8_t iManufacturer; /* Index of manu. string descriptor */ - uint8_t iProduct; /* Index of prod. string descriptor */ - uint8_t iSerialNumber; /* Index of S.N. string descriptor */ - uint8_t bNumConfigurations; /* Number of possible configurations */ + uint8_t bLength; /**< Size of this descriptor in bytes. */ + uint8_t bDescriptorType; /**< DEVICE descriptor type */ + uint16_t bscUSB; /**< Binay Coded Decimal Spec. release */ + uint8_t bDeviceClass; /**< Class code assigned by the USB */ + uint8_t bDeviceSubClass; /**< Sub-class code assigned by the USB */ + uint8_t bDeviceProtocol; /**< Protocol code assigned by the USB */ + uint8_t bMaxPacketSize0; /**< Max packet size for EP0 */ + uint16_t idVendor; /**< Vendor ID. ATMEL = 0x03EB */ + uint16_t idProduct; /**< Product ID assigned by the manufacturer */ + uint16_t bcdDevice; /**< Device release number */ + uint8_t iManufacturer; /**< Index of manu. string descriptor */ + uint8_t iProduct; /**< Index of prod. string descriptor */ + uint8_t iSerialNumber; /**< Index of S.N. string descriptor */ + uint8_t bNumConfigurations; /**< Number of possible configurations */ }; struct usb_st_configuration_descriptor { - uint8_t bLength; /** size of this descriptor in bytes */ - uint8_t bDescriptorType; /** CONFIGURATION descriptor type */ - uint16_t wTotalLength; /** total length of data returned */ - uint8_t bNumInterfaces; /** number of interfaces for this conf. */ - uint8_t bConfigurationValue; /** value for SetConfiguration resquest */ - uint8_t iConfiguration; /** index of string descriptor */ - uint8_t bmAttibutes; /** Configuration characteristics */ - uint8_t MaxPower; /** maximum power consumption */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< CONFIGURATION descriptor type */ + uint16_t wTotalLength; /**< total length of data returned */ + uint8_t bNumInterfaces; /**< number of interfaces for this conf. */ + uint8_t bConfigurationValue; /**< value for SetConfiguration resquest */ + uint8_t iConfiguration; /**< index of string descriptor */ + uint8_t bmAttibutes; /**< Configuration characteristics */ + uint8_t MaxPower; /**< maximum power consumption */ }; struct usb_st_interface_descriptor { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* INTERFACE descriptor type */ - uint8_t bInterfaceNumber; /* Number of interface */ - uint8_t bAlternateSetting; /* value to select alternate setting */ - uint8_t bNumEndpoints; /* Number of EP except EP 0 */ - uint8_t bInterfaceClass; /* Class code assigned by the USB */ - uint8_t bInterfaceSubClass; /* Sub-class code assigned by the USB */ - uint8_t bInterfaceProtocol; /* Protocol code assigned by the USB */ - uint8_t iInterface; /* Index of string descriptor */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< INTERFACE descriptor type */ + uint8_t bInterfaceNumber; /**< Number of interface */ + uint8_t bAlternateSetting; /**< value to select alternate setting */ + uint8_t bNumEndpoints; /**< Number of EP except EP 0 */ + uint8_t bInterfaceClass; /**< Class code assigned by the USB */ + uint8_t bInterfaceSubClass; /**< Sub-class code assigned by the USB */ + uint8_t bInterfaceProtocol; /**< Protocol code assigned by the USB */ + uint8_t iInterface; /**< Index of string descriptor */ }; struct usb_st_endpoint_descriptor { - uint8_t bLength; /* Size of this descriptor in bytes */ - uint8_t bDescriptorType; /* ENDPOINT descriptor type */ - uint8_t bEndpointAddress; /* Address of the endpoint */ - uint8_t bmAttributes; /* Endpoint's attributes */ - uint16_t wMaxPacketSize; /* Maximum packet size for this EP */ - uint8_t bInterval; /* Interval for polling EP in ms */ + uint8_t bLength; /**< Size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< ENDPOINT descriptor type */ + uint8_t bEndpointAddress; /**< Address of the endpoint */ + uint8_t bmAttributes; /**< Endpoint's attributes */ + uint16_t wMaxPacketSize; /**< Maximum packet size for this EP */ + uint8_t bInterval; /**< Interval for polling EP in ms */ }; struct usb_st_manufacturer { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* STRING descriptor type */ - uint16_t wstring[USB_MN_LENGTH];/* unicode characters */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< STRING descriptor type */ + uint16_t wstring[USB_MN_LENGTH];/**< unicode characters */ }; struct usb_st_product { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* STRING descriptor type */ - uint16_t wstring[USB_PN_LENGTH];/* unicode characters */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< STRING descriptor type */ + uint16_t wstring[USB_PN_LENGTH];/**< unicode characters */ }; struct usb_st_serial_number { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* STRING descriptor type */ - uint16_t wstring[USB_SN_LENGTH];/* unicode characters */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< STRING descriptor type */ + uint16_t wstring[USB_SN_LENGTH];/**< unicode characters */ }; struct usb_st_config { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* STRING descriptor type */ - uint16_t wstring[USB_CONFIG_LENGTH];/* unicode characters */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< STRING descriptor type */ + uint16_t wstring[USB_CONFIG_LENGTH];/**< unicode characters */ }; struct usb_st_language_descriptor { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* STRING descriptor type */ - uint16_t wstring[USB_CONFIG_LENGTH]; /* language id */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< STRING descriptor type */ + uint16_t wstring[USB_CONFIG_LENGTH]; /**< language id */ }; struct usb_st_speaker_descriptor { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* STRING descriptor type */ - uint16_t wstring[AUDIO_SPEAKER_LENGTH]; /* language id */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< STRING descriptor type */ + uint16_t wstring[AUDIO_SPEAKER_LENGTH]; /**< language id */ }; struct usb_st_micro_descriptor { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* STRING descriptor type */ - uint16_t wstring[AUDIO_MICRO_LENGTH]; /* language id */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< STRING descriptor type */ + uint16_t wstring[AUDIO_MICRO_LENGTH]; /**< language id */ }; struct usb_st_tts_descriptor { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* STRING descriptor type */ - uint16_t wstring[AUDIO_TTS_LENGTH]; /* language id */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< STRING descriptor type */ + uint16_t wstring[AUDIO_TTS_LENGTH]; /**< language id */ }; struct usb_st_audio_descriptor { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* STRING descriptor type */ - uint16_t wstring[AUDIO_NORMAL_LENGTH]; /* language id */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< STRING descriptor type */ + uint16_t wstring[AUDIO_NORMAL_LENGTH]; /**< language id */ }; /* HID specific */ struct usb_hid_descriptor { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* INTERFACE descriptor type */ - uint16_t bcdHID; /* HID spec. */ - uint8_t bCountryCode; /* Country code value*/ - uint8_t bNumDescriptors; /* Number of reports descriptor */ - uint8_t bDescriptorTypeRep; /* Type of the class-specific descriptor */ - uint16_t wDescriptorLength; /* Size of the report descriptor */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< INTERFACE descriptor type */ + uint16_t bcdHID; /**< HID spec. */ + uint8_t bCountryCode; /**< Country code value*/ + uint8_t bNumDescriptors; /**< Number of reports descriptor */ + uint8_t bDescriptorTypeRep; /**< Type of the class-specific descriptor */ + uint16_t wDescriptorLength; /**< Size of the report descriptor */ }; /* Audio Class specific */ struct usb_Audio_st_ACinterface_descriptor { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* INTERFACE descriptor type */ - uint8_t bInterfaceNumber; /* Number of interface */ - uint8_t bAlternateSetting; /* value to select alternate setting */ - uint8_t bNumEndpoints; /* Number of EP except EP 0 */ - uint8_t bInterfaceClass; /* Class code assigned by the USB */ - uint8_t bInterfaceSubClass; /* Sub-class code assigned by the USB */ - uint8_t bInterfaceProtocol; /* Protocol code assigned by the USB */ - uint8_t iInterface; /* Index of string descriptor */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< INTERFACE descriptor type */ + uint8_t bInterfaceNumber; /**< Number of interface */ + uint8_t bAlternateSetting; /**< value to select alternate setting */ + uint8_t bNumEndpoints; /**< Number of EP except EP 0 */ + uint8_t bInterfaceClass; /**< Class code assigned by the USB */ + uint8_t bInterfaceSubClass; /**< Sub-class code assigned by the USB */ + uint8_t bInterfaceProtocol; /**< Protocol code assigned by the USB */ + uint8_t iInterface; /**< Index of string descriptor */ }; struct usb_Audio_cs_ACinterface_descriptor { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* INTERFACE descriptor type */ - uint8_t bDescriptorSubtype; /* HEADER descriptor subtype.*/ - uint16_t bcdADC; /* Audio Device Class Specification Release Number in Binary-Coded Decimal */ - uint16_t wTotalLength; /* Total number of bytes returned for the class-specific AudioControl interface descriptor */ - uint8_t bInCollection; /* Number of EP except EP 0 */ - uint8_t baInterfaceNr[2]; /* Class code assigned by the USB */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< INTERFACE descriptor type */ + uint8_t bDescriptorSubtype; /**< HEADER descriptor subtype.*/ + uint16_t bcdADC; /**< Audio Device Class Specification Release Number in Binary-Coded Decimal */ + uint16_t wTotalLength; /**< Total number of bytes returned for the class-specific AudioControl interface descriptor */ + uint8_t bInCollection; /**< Number of EP except EP 0 */ + uint8_t baInterfaceNr[2]; /**< Class code assigned by the USB */ }; struct usb_Audio_cs_ACinterface_descriptor_NbCol1 { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* INTERFACE descriptor type */ - uint8_t bDescriptorSubtype; /* HEADER descriptor subtype.*/ - uint16_t bcdADC; /* Audio Device Class Specification Release Number in Binary-Coded Decimal */ - uint16_t wTotalLength; /* Total number of bytes returned for the class-specific AudioControl interface descriptor */ - uint8_t bInCollection; /* Number of EP except EP 0 */ - uint8_t baInterfaceNr[1]; /* Class code assigned by the USB */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< INTERFACE descriptor type */ + uint8_t bDescriptorSubtype; /**< HEADER descriptor subtype.*/ + uint16_t bcdADC; /**< Audio Device Class Specification Release Number in Binary-Coded Decimal */ + uint16_t wTotalLength; /**< Total number of bytes returned for the class-specific AudioControl interface descriptor */ + uint8_t bInCollection; /**< Number of EP except EP 0 */ + uint8_t baInterfaceNr[1]; /**< Class code assigned by the USB */ }; /* Audio input terminal */ struct usb_Audio_InputTerminal_descriptor { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* INTERFACE descriptor type */ - uint8_t bDescriptorSubtype; /* HEADER descriptor subtype.*/ - uint8_t bTerminalID; /* CConstant characterizing the type of Termina*/ - uint16_t wTerminalType; /* Constant characterizing the type of Terminal.*/ - uint8_t bAssocTerminal; /* ID of the Output Terminal to which this Input Terminal is associated */ - uint8_t bNrChannels; /* Number of logical output channels in the Terminals output audio channel cluster. */ - uint16_t wChannelConfig; /* Describes the spatial location of the logical channels.*/ - uint8_t iChannelNames; /*Index of a string descriptor, describing the name of the first logical channel */ - uint8_t iTerminal; /*Index of a string descriptor, describing the Input Terminal. */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< INTERFACE descriptor type */ + uint8_t bDescriptorSubtype; /**< HEADER descriptor subtype.*/ + uint8_t bTerminalID; /**< Constant characterizing the type of Termina*/ + uint16_t wTerminalType; /**< Constant characterizing the type of Terminal.*/ + uint8_t bAssocTerminal; /**< ID of the Output Terminal to which this Input Terminal is associated */ + uint8_t bNrChannels; /**< Number of logical output channels in the Terminals output audio channel cluster. */ + uint16_t wChannelConfig; /**< Describes the spatial location of the logical channels.*/ + uint8_t iChannelNames; /**< Index of a string descriptor, describing the name of the first logical channel */ + uint8_t iTerminal; /**< Index of a string descriptor, describing the Input Terminal. */ }; /* Audio output terminal */ struct usb_Audio_OutputTerminal_descriptor { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* INTERFACE descriptor type */ - uint8_t bDescriptorSubtype; /* HEADER descriptor subtype.*/ - uint8_t bTerminalID; /* CConstant characterizing the type of Termina*/ - uint16_t wTerminalType; /* Constant characterizing the type of Terminal.*/ - uint8_t bAssocTerminal; /* ID of the Output Terminal to which this Input Terminal is associated */ - uint8_t bSourceID; /*ID of the Unit or Terminal to which this Terminal is connected */ - uint8_t iTerminal; /*Index of a string descriptor, describing the Input Terminal. */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< INTERFACE descriptor type */ + uint8_t bDescriptorSubtype; /**< HEADER descriptor subtype.*/ + uint8_t bTerminalID; /**< Constant characterizing the type of Termina*/ + uint16_t wTerminalType; /**< Constant characterizing the type of Terminal.*/ + uint8_t bAssocTerminal; /**< ID of the Output Terminal to which this Input Terminal is associated */ + uint8_t bSourceID; /**< ID of the Unit or Terminal to which this Terminal is connected */ + uint8_t iTerminal; /**< Index of a string descriptor, describing the Input Terminal. */ }; /* Audio feature unit */ struct usb_Audio_FeatureUnit_descriptor { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* INTERFACE descriptor type */ - uint8_t bDescriptorSubtype; /* HEADER descriptor subtype.*/ - uint8_t bUnitID; /* Constant uniquely identifying the Unit within the audio function.*/ - uint8_t bSourceID; /* Constant characterizing the type of Terminal.*/ - uint8_t bControlSize; /* Size in bytes of an element of the bmaControls() array: n*/ - uint8_t bmaControls[2]; /*ID of the Unit or Terminal to which this Terminal is connected */ - uint8_t iFeature; /*Index of a string descriptor, describing this Feature Unit.. */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< INTERFACE descriptor type */ + uint8_t bDescriptorSubtype; /**< HEADER descriptor subtype.*/ + uint8_t bUnitID; /**< Constant uniquely identifying the Unit within the audio function.*/ + uint8_t bSourceID; /**< Constant characterizing the type of Terminal.*/ + uint8_t bControlSize; /**< Size in bytes of an element of the bmaControls() array: n*/ + uint8_t bmaControls[2]; /**< ID of the Unit or Terminal to which this Terminal is connected */ + uint8_t iFeature; /**< Index of a string descriptor, describing this Feature Unit.. */ }; /* Audio stream */ struct usb_Audio_st_ASinterface_descriptor { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* INTERFACE descriptor type */ - uint8_t bInterfaceNumber; /* Number of interface */ - uint8_t bAlternateSetting; /* value to select alternate setting */ - uint8_t bNumEndpoints; /* Number of EP except EP 0 */ - uint8_t bInterfaceClass; /* Class code assigned by the USB */ - uint8_t bInterfaceSubClass; /* Sub-class code assigned by the USB */ - uint8_t bInterfaceProtocol; /* Protocol code assigned by the USB */ - uint8_t iInterface; /* Index of string descriptor */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< INTERFACE descriptor type */ + uint8_t bInterfaceNumber; /**< Number of interface */ + uint8_t bAlternateSetting; /**< value to select alternate setting */ + uint8_t bNumEndpoints; /**< Number of EP except EP 0 */ + uint8_t bInterfaceClass; /**< Class code assigned by the USB */ + uint8_t bInterfaceSubClass; /**< Sub-class code assigned by the USB */ + uint8_t bInterfaceProtocol; /**< Protocol code assigned by the USB */ + uint8_t iInterface; /**< Index of string descriptor */ }; /* Audio class specific */ struct usb_Audio_cs_ASinterface_descriptor { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* INTERFACE descriptor type */ - uint8_t bDescriptorSubtype; /* AS_GENERAL descriptor subtype.*/ - uint8_t bTerminalLink; /* The Terminal ID of the Terminal to which the endpoint of this interface is connected.*/ - uint8_t bDelay; /* Delay (d) introduced by the data path */ - uint16_t wFormatTag; /* Class code assigned by the USB */ + uint8_t bLength; /**< size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< INTERFACE descriptor type */ + uint8_t bDescriptorSubtype; /**< AS_GENERAL descriptor subtype.*/ + uint8_t bTerminalLink; /**< The Terminal ID of the Terminal to which the endpoint of this interface is connected.*/ + uint8_t bDelay; /**< Delay (d) introduced by the data path */ + uint16_t wFormatTag; /**< Class code assigned by the USB */ }; /* Audio EP */ struct usb_Audio_st_endpoint_descriptor { - uint8_t bLength; /* Size of this descriptor in bytes */ - uint8_t bDescriptorType; /* ENDPOINT descriptor type */ - uint8_t bEndpointAddress; /* Address of the endpoint */ - uint8_t bmAttributes; /* Endpoint's attributes */ - uint16_t wMaxPacketSize; /* Maximum packet size for this EP */ - uint8_t bInterval; /* Interval for polling EP in ms */ - uint8_t bRefresh; /* Reset to 0.*/ - uint8_t bSynchAddress; /* The address of the endpoint used to communicate synchronization information if required by this endpoint..*/ + uint8_t bLength; /**< Size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< ENDPOINT descriptor type */ + uint8_t bEndpointAddress; /**< Address of the endpoint */ + uint8_t bmAttributes; /**< Endpoint's attributes */ + uint16_t wMaxPacketSize; /**< Maximum packet size for this EP */ + uint8_t bInterval; /**< Interval for polling EP in ms */ + uint8_t bRefresh; /**< Reset to 0.*/ + uint8_t bSynchAddress; /**< The address of the endpoint used to communicate synchronization information if required by this endpoint..*/ }; /* Audio stream */ struct usb_Audio_cs_ASendpoint_descriptor { - uint8_t bLength; /* Size of this descriptor in bytes */ - uint8_t bDescriptorType; /* ENDPOINT descriptor type */ - uint8_t bDescriptorSubtype; /* EP_GENERAL descriptor subtype. */ - uint8_t bmAttributes; /* Endpoint's attributes */ - uint8_t bLockDelayUnits; /*Indicates the units used for the wLockDelay field:*/ - uint16_t wLockDelay; /* Reset to 0.*/ + uint8_t bLength; /**< Size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< ENDPOINT descriptor type */ + uint8_t bDescriptorSubtype; /**< EP_GENERAL descriptor subtype. */ + uint8_t bmAttributes; /**< Endpoint's attributes */ + uint8_t bLockDelayUnits; /**< Indicates the units used for the wLockDelay field:*/ + uint16_t wLockDelay; /**< Reset to 0.*/ }; /* Audio endpoint */ struct usb_Audio_TYPEI_FormatType_descriptor { - uint8_t bLength; /* Size of this descriptor in bytes */ - uint8_t bDescriptorType; /* ENDPOINT descriptor type */ - uint8_t bDescriptorSubtype; /* EP_GENERAL descriptor subtype. */ - uint8_t bFormatType; /* FORMAT_TYPE_I. Constant identifying the Format Type the AudioStreaming interface is using.*/ - uint8_t bNrChannels; /*Indicates the number of physical channels in the audio data stream.:*/ - uint8_t bSubframeSize; /* The number of bytes occupied by one audio subframe. Can be 1, 2, 3 or 4.*/ - uint8_t bBitResolution; /* The number of effectively used bits from the available bits in an audio subframe.*/ - uint8_t bSamFreqType; /*Indicates how the sampling frequency can be programmed */ - uint8_t bSamFreqTbl[3]; /*See sampling frequency tables*/ + uint8_t bLength; /**< Size of this descriptor in bytes */ + uint8_t bDescriptorType; /**< ENDPOINT descriptor type */ + uint8_t bDescriptorSubtype; /**< EP_GENERAL descriptor subtype. */ + uint8_t bFormatType; /**< FORMAT_TYPE_I. Constant identifying the Format Type the AudioStreaming interface is using.*/ + uint8_t bNrChannels; /**< Indicates the number of physical channels in the audio data stream.:*/ + uint8_t bSubframeSize; /**< The number of bytes occupied by one audio subframe. Can be 1, 2, 3 or 4.*/ + uint8_t bBitResolution; /**< The number of effectively used bits from the available bits in an audio subframe.*/ + uint8_t bSamFreqType; /**< Indicates how the sampling frequency can be programmed */ + uint8_t bSamFreqTbl[3]; /**< See sampling frequency tables*/ }; /** \name General structure @@ -491,73 +491,99 @@ * @{ */ struct usb_configuration_s { - /** Configuration descriptor */ + /*! Configuration descriptor */ struct usb_st_configuration_descriptor cfg; + - /** \name Interface 0 : Audio control - * @{ */ - /** Standard interface descriptor */ + // Interface O :: Audio Control + //------------------------------------------------------------------------- + /*! Standard interface descriptor */ struct usb_Audio_st_ACinterface_descriptor StandardACInterfaceDescriptor_1; - /** Specific interface descriptor */ + /*! Specific interface descriptor */ struct usb_Audio_cs_ACinterface_descriptor SpecificACInterfaceDescriptor; - /** Microphone input terminal */ + /*! Microphone input terminal */ struct usb_Audio_InputTerminal_descriptor MicInputTerminal1Descriptor; - /** Speaker input terminal */ + /*! Speaker input terminal */ struct usb_Audio_InputTerminal_descriptor SpkInputTerminalDescriptor; - /** Microphone output terminal */ + /*! Microphone output terminal */ struct usb_Audio_OutputTerminal_descriptor MicOutputTerminal1Descriptor; - /** Speaker output descriptor */ + /*! Speaker output descriptor */ struct usb_Audio_OutputTerminal_descriptor SpkOutputTerminalDescriptor; - /* @} */ // Interface 1 :: Audio Stream Microphone //------------------------------------------------------------------------- + /*! Standard interface descriptor (alt. 0) */ struct usb_Audio_st_ASinterface_descriptor MicStandardAlt0ASInterfaceDescriptor; + /*! Standard interface descriptor (alt. 1 - active) */ struct usb_Audio_st_ASinterface_descriptor MicStandardAlt1ASInterfaceDescriptor; + /*! Specific audio stream interface descriptor */ struct usb_Audio_cs_ASinterface_descriptor MicSpecificASInterfaceDescriptor; + /*! Format descriptor */ struct usb_Audio_TYPEI_FormatType_descriptor MicFormatTypeDescriptor; + /*! Standard endpoint descriptor */ struct usb_Audio_st_endpoint_descriptor MicStandardEndpointDescriptor; + /*! Endpoint */ struct usb_Audio_cs_ASendpoint_descriptor MicEndpointDescriptor; // Interface 2 :: Audio Stream Speaker //------------------------------------------------------------------------- + /*! Standard interface descriptor (alt. 0) */ struct usb_Audio_st_ASinterface_descriptor SpkStandardAlt0ASInterfaceDescriptor; + /*! Standard interface descriptor (alt. 1 - active) */ struct usb_Audio_st_ASinterface_descriptor SpkStandardAlt1ASInterfaceDescriptor; + /*! Specific audio stream interface descriptor */ struct usb_Audio_cs_ASinterface_descriptor SpkSpecificASInterfaceDescriptor; + /*! Format descriptor */ struct usb_Audio_TYPEI_FormatType_descriptor SpkFormatTypeDescriptor; + /*! Standard endpoint descriptor */ struct usb_Audio_st_endpoint_descriptor SpkStandardEndpointDescriptor; + /*! Endpoint */ struct usb_Audio_cs_ASendpoint_descriptor SpkEndpointDescriptor; - //------------------------------------------------------------------------- - // "HID" - //------------------------------------------------------------------------- // Interface 3 :: Command / Status Interface //------------------------------------------------------------------------- #ifdef HID_DEVICE + /*! Standard interface descriptor */ struct usb_st_interface_descriptor HIDInterfaceDescriptor; + /*! HID interface descriptor */ struct usb_hid_descriptor HIDStandardDescriptor; + /*! Standard EP descriptor */ struct usb_st_endpoint_descriptor HID_InEndpointDescriptor; + /*! Standard EP descriptor */ struct usb_st_endpoint_descriptor HID_OutEndpointDescriptor; #else + /*! Standard interface descriptor */ struct usb_st_interface_descriptor HIDInterfaceDescriptor; + /*! Standard EP descriptor */ struct usb_st_endpoint_descriptor HID_InEndpointDescriptor; + /*! Standard EP descriptor */ struct usb_st_endpoint_descriptor HID_OutEndpointDescriptor; #endif // Interface 4 :: Audio Control //------------------------------------------------------------------------- - struct usb_Audio_st_ACinterface_descriptor StandardACInterfaceDescriptor_TTS; + /*! Standard interface descriptor */ + struct usb_Audio_st_ACinterface_descriptor StandardACInterfaceDescriptor_TTS; + /*! Specific interface descriptor */ struct usb_Audio_cs_ACinterface_descriptor_NbCol1 SpecificACInterfaceDescriptor_TTS; + /*! TTS input terminal */ struct usb_Audio_InputTerminal_descriptor SpkInputTerminalDescriptor_TTS; + /*! TTS output terminal */ struct usb_Audio_OutputTerminal_descriptor SpkOutputTerminalDescriptor_TTS; // Interface 5 :: Audio Stream //------------------------------------------------------------------------- + /*! Standard interface descriptor (alt. 0) */ struct usb_Audio_st_ASinterface_descriptor SpkStandardAlt0ASInterfaceDescriptor_TTS; + /*! Standard interface descriptor (alt. 1 - active) */ struct usb_Audio_st_ASinterface_descriptor SpkStandardAlt1ASInterfaceDescriptor_TTS; + /*! Specific audio stream interface descriptor */ struct usb_Audio_cs_ASinterface_descriptor SpkSpecificASInterfaceDescriptor_TTS; + /*! Format descriptor */ struct usb_Audio_TYPEI_FormatType_descriptor SpkFormatTypeDescriptor_TTS; + /*! Standard endpoint descriptor */ struct usb_Audio_st_endpoint_descriptor SpkStandardEndpointDescriptor_TTS; + /*! Endpoint */ struct usb_Audio_cs_ASendpoint_descriptor SpkEndpointDescriptor_TTS; #ifdef HID_DEVICE |
From: remi <c2m...@c2...> - 2008-05-20 20:13:50
|
Author: remi Date: 2008-05-20 22:13:51 +0200 (Tue, 20 May 2008) New Revision: 1180 Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.h software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_types.h software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c Log: * Added a command to remove the 'orphan' system commands. (When you perform a command type 'on_during', a 'off' command is automatically inserted into the system stack to stop the movement after the specified delay. But if you perform yourself a 'off' command before the end of delay, the 'off' cmd from the system would be deleted). * Added the support of 'remaining_movements' for the 'on_during' commands and the 'off' commands. Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.c 2008-05-20 12:59:06 UTC (rev 1179) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.c 2008-05-20 20:13:51 UTC (rev 1180) @@ -1004,6 +1004,57 @@ /** * */ +LIBLOCAL void +tux_cmd_parser_clean_sys_command(tux_command_t command) +{ + int i, j; + bool have_parent = true; + + printf("Cleaning sys commands"); + + /* For all sys commands */ + for (i = 0; i < NRCMDS; i++) + { + /* System command match */ + if ((sys_cmd_stack.cmd_list[i].command == command) && + (sys_cmd_stack.cmd_list[i].command_group != NO_CMD)) + { + /* Find the user command (on_during) which have insert this + * system command. + */ + have_parent = false; + + for (j = 0; j < NRCMDS; j++) + { + /* Possible user command*/ + if ((user_cmd_stack.cmd_list[j].command == command) && + (user_cmd_stack.cmd_list[j].command_group != NO_CMD)) + { + /* Ok : system command have a parent user command */ + if (user_cmd_stack.cmd_list[j].inserted_at_time ==\ + sys_cmd_stack.cmd_list[i].inserted_at_time) + { + have_parent = true; + break; + } + } + } + + /* The system command is orphan */ + if (!have_parent) + { + /* The system command must be deleted */ + sys_cmd_stack.cmd_list[i].command_group = NO_CMD; + sys_cmd_stack.cmd_list[i].timeout = 0.; + sys_cmd_stack.cmd_list[i].inserted_at_time = 0.; + } + } + } +} + +/** + * + */ static TuxDrvError insert_command(float delay, delay_cmd_t *cmd, cmd_stack_t *stack) { @@ -1017,6 +1068,7 @@ { stack->cmd_list[i] = *cmd; stack->cmd_list[i].timeout = delay + curtime; + stack->cmd_list[i].inserted_at_time = (float)(int)(curtime * 100) / 100.0; ret = E_TUXDRV_NOERROR; break; } Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.h 2008-05-20 12:59:06 UTC (rev 1179) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.h 2008-05-20 20:13:51 UTC (rev 1180) @@ -42,6 +42,7 @@ delay_cmd_t *cmd); extern TuxDrvError tux_cmd_parser_insert_user_command(float delay, const char *cmd_str); +extern void tux_cmd_parser_clean_sys_command(tux_command_t command); extern void tux_cmd_parser_delay_stack_perform(void); extern TuxDrvError tux_cmd_parser_parse_macro(const char *macro_str); extern TuxDrvError tux_cmd_parser_parse_file(const char *file_path); Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.c 2008-05-20 12:59:06 UTC (rev 1179) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.c 2008-05-20 20:13:51 UTC (rev 1180) @@ -30,6 +30,8 @@ #include "tux_types.h" #include "tux_usb.h" +static unsigned char mvmt_counter = 0; + /** * Update the status of the position of the eyes. */ @@ -67,6 +69,7 @@ new_count = hw_status_table.position1.eyes_remaining_mvm; + mvmt_counter = new_count; tux_sw_status_set_intvalue(SW_ID_EYES_REMAINING_MVM, new_count, true); } @@ -103,6 +106,9 @@ return false; } + mvmt_counter = 255; + tux_sw_status_set_intvalue(SW_ID_EYES_REMAINING_MVM, mvmt_counter, true); + switch (final_state) { case FINAL_ST_UNDEFINED: cmd.sub_command = OFF; @@ -146,5 +152,21 @@ LIBLOCAL bool tux_eyes_cmd_off(void) { - return tux_movement_perform(MOVE_EYES, 0, 0, 5, FINAL_ST_STOP, false); + bool ret; + + tux_cmd_parser_clean_sys_command(EYES); + + if (mvmt_counter == 0) + { + ret = tux_movement_perform(MOVE_EYES, 0, 0, 5, FINAL_ST_STOP, false); + } + else + { + ret = tux_movement_cmd_on(MOVE_EYES, 1, FINAL_ST_UNDEFINED); + } + + mvmt_counter = 0; + tux_sw_status_set_intvalue(SW_ID_EYES_REMAINING_MVM, mvmt_counter, true); + + return ret; } Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.c 2008-05-20 12:59:06 UTC (rev 1179) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.c 2008-05-20 20:13:51 UTC (rev 1180) @@ -30,6 +30,8 @@ #include "tux_types.h" #include "tux_usb.h" +static unsigned char mvmt_counter = 0; + /** * */ @@ -67,6 +69,7 @@ new_count = hw_status_table.position1.mouth_remaining_mvm; + mvmt_counter = new_count; tux_sw_status_set_intvalue(SW_ID_MOUTH_REMAINING_MVM, new_count, true); } @@ -104,6 +107,9 @@ return false; } + mvmt_counter = 255; + tux_sw_status_set_intvalue(SW_ID_MOUTH_REMAINING_MVM, mvmt_counter, true); + switch (final_state) { case FINAL_ST_UNDEFINED: cmd.sub_command = OFF; @@ -147,5 +153,21 @@ LIBLOCAL bool tux_mouth_cmd_off(void) { - return tux_movement_perform(MOVE_MOUTH, 0, 0, 5, FINAL_ST_STOP, false); + bool ret; + + tux_cmd_parser_clean_sys_command(MOUTH); + + if (mvmt_counter == 0) + { + ret = tux_movement_perform(MOVE_MOUTH, 0, 0, 5, FINAL_ST_STOP, false); + } + else + { + ret = tux_movement_cmd_on(MOVE_MOUTH, 1, FINAL_ST_UNDEFINED); + } + + mvmt_counter = 0; + tux_sw_status_set_intvalue(SW_ID_MOUTH_REMAINING_MVM, mvmt_counter, true); + + return ret; } Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.c 2008-05-20 12:59:06 UTC (rev 1179) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.c 2008-05-20 20:13:51 UTC (rev 1180) @@ -29,6 +29,8 @@ #include "tux_types.h" #include "tux_usb.h" +static unsigned char mvmt_counter = 0; + /** * */ @@ -70,6 +72,7 @@ new_count = hw_status_table.position2.spin_remaining_mvm; + mvmt_counter = new_count; tux_sw_status_set_intvalue(SW_ID_SPINNING_REMAINING_MVM, new_count, true); } @@ -126,6 +129,9 @@ return tux_movement_perform(movement, 0, timeout, 5, FINAL_ST_UNDEFINED, false); } + + mvmt_counter = 255; + tux_sw_status_set_intvalue(SW_ID_SPINNING_REMAINING_MVM, mvmt_counter, true); /* Long movements */ ret = tux_usb_send_to_tux(frame); @@ -163,5 +169,21 @@ LIBLOCAL bool tux_spinning_cmd_off(void) { - return tux_movement_perform(MOVE_SPIN_R, 0, 0, 5, FINAL_ST_STOP, false); + bool ret; + + tux_cmd_parser_clean_sys_command(SPINNING); + + if (mvmt_counter == 0) + { + ret = tux_movement_perform(MOVE_SPIN_R, 0, 0, 5, FINAL_ST_STOP, false); + } + else + { + ret = tux_movement_cmd_on(MOVE_SPIN_R, 1, FINAL_ST_UNDEFINED); + } + + mvmt_counter = 0; + tux_sw_status_set_intvalue(SW_ID_SPINNING_REMAINING_MVM, mvmt_counter, true); + + return ret; } Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_types.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_types.h 2008-05-20 12:59:06 UTC (rev 1179) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_types.h 2008-05-20 20:13:51 UTC (rev 1180) @@ -226,6 +226,7 @@ wings_speed_parameters_t wings_speed_parameters; raw_parameters_t raw_parameters; }; + float inserted_at_time; } delay_cmd_t; #endif /* _TUX_TYPES_H_ */ Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c 2008-05-20 12:59:06 UTC (rev 1179) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c 2008-05-20 20:13:51 UTC (rev 1180) @@ -29,6 +29,8 @@ #include "tux_usb.h" #include "tux_wings.h" +static unsigned char mvmt_counter = 0; + /** * */ @@ -59,6 +61,7 @@ new_count = hw_status_table.position1.wings_remaining_mvm; + mvmt_counter = new_count; tux_sw_status_set_intvalue(SW_ID_WINGS_REMAINING_MVM, new_count, true); } @@ -105,6 +108,9 @@ return false; } + mvmt_counter = 255; + tux_sw_status_set_intvalue(SW_ID_WINGS_REMAINING_MVM, mvmt_counter, true); + switch (final_state) { case FINAL_ST_UNDEFINED: cmd.sub_command = OFF; @@ -148,5 +154,21 @@ LIBLOCAL bool tux_wings_cmd_off(void) { - return tux_movement_perform(MOVE_FLIPPERS, 0, 0, 5, FINAL_ST_STOP, false); + bool ret; + + tux_cmd_parser_clean_sys_command(WINGS); + + if (mvmt_counter == 0) + { + ret = tux_movement_perform(MOVE_FLIPPERS, 0, 0, 5, FINAL_ST_STOP, false); + } + else + { + ret = tux_movement_cmd_on(MOVE_FLIPPERS, 1, FINAL_ST_UNDEFINED); + } + + mvmt_counter = 0; + tux_sw_status_set_intvalue(SW_ID_WINGS_REMAINING_MVM, mvmt_counter, true); + + return ret; } |
From: Paul_R <c2m...@c2...> - 2008-05-20 12:59:03
|
Author: Paul_R Date: 2008-05-20 14:59:06 +0200 (Tue, 20 May 2008) New Revision: 1179 Modified: firmware/fuxusb/trunk/src/config.h firmware/fuxusb/trunk/src/global.c firmware/fuxusb/trunk/src/global.h firmware/fuxusb/trunk/src/usb_commands.c firmware/fuxusb/trunk/src/usb_desc.h firmware/fuxusb/trunk/src/usb_misc.c firmware/fuxusb/trunk/src/usb_misc.h Log: * Removed reattach_usb from usb_misc to create a define in global.h * Moved descriptors defines from config.h to usb_desc.h Modified: firmware/fuxusb/trunk/src/config.h =================================================================== --- firmware/fuxusb/trunk/src/config.h 2008-05-20 12:25:48 UTC (rev 1178) +++ firmware/fuxusb/trunk/src/config.h 2008-05-20 12:59:06 UTC (rev 1179) @@ -27,11 +27,9 @@ #include "lib_mcu/reg_5131.h" #include "lib_mcu/ext_5131.h" #include "lib_mcu/5131_drv.h" -#include <stdio.h> -/* Enable the HID interface */ -#define HID_DEVICE + /* Debug modes : Don't forget to define MAIN_DEBUG to be able to use printf */ //#define MAIN_DEBUG //#define BL_EP_DEBUG @@ -54,105 +52,20 @@ #define False 0 #define True 1 -/* USB Configuration */ -/* Endpoints */ +/** \name Endpoints + * @{ */ #define EP_AUDIO_IN 1 #define EP_AUDIO_OUT 2 #define EP_AUDIO_OUT_TTS 3 #define EP_CMD_IN 4 #define EP_CMD_OUT 5 -/* Device specifications and classes */ -#define USB_SPECIFICATION 0x1001 -#define DEVICE_CLASS 0x00 -#define DEVICE_SUB_CLASS 0 -#define DEVICE_PROTOCOL 0 -#define EP_CONTROL_LENGTH 32 -#define NB_CONFIGURATION 1 - -/* Version - PID/VID */ -#define VENDOR_ID 0xEB03 /* Atmel vendor ID = 03EBh */ -#define PRODUCT_ID 0x07FF /* Product ID: FF07h*/ -#define RELEASE_NUMBER (0x0100*VER_UPDATE) + (0x1000*VER_MINOR) +\ - (0x0001*VER_MAJOR) - -/* CONFIGURATION DESCRIPTOR */ -#ifdef HID_DEVICE -# define SIZE_OF_REPORT 0x22 -# define CONF_LENGTH 0x2901 // 297 -# define NB_INTERFACE 6 -#else -# define CONF_LENGTH 0x2001 // 288 -# define NB_INTERFACE 6 -#endif - -#define CONF_NB 1 -#define CONF_ATTRIBUTES USB_CONFIG_BUSPOWERED -#define MAX_POWER 50 /* 100 mA */ - -#define LANG_ID 0x00 -#define LANGUAGE_ID 0x0904 - -#define EP_CONTROL 0x00 -#define EP_IN 0x01 -#define EP_KBD_IN EP_IN -#define EP_IN_LENGTH 64 +#define EP_CONTROL 0 +#define EP_IN 0x01 #define ENDPOINT_0 0x00 #define ENDPOINT_1 0x81 +/* @} */ -#define RX_EP 2 -#define TX_EP 1 -#define TX_EP_SIZE 32 -/* STRING INDEX */ -/*******************************************/ - -#define MAN_STRING_INDEX 1 -#define PROD_STRING_INDEX 2 -#define SN_STRING_INDEX 3 -#define CONFIG_STRING_INDEX 4 -#define AUDIO_SPEAKER_INDEX 5 -#define AUDIO_MICRO_INDEX 6 -#define AUDIO_TTS_INDEX 7 -#define AUDIO_NORMAL_INDEX 8 - - -#define USB_MANUFACTURER_NAME {'K'<<8, 'y'<<8, 's'<<8, 'o'<<8, 'h'<<8} -#define USB_MN_LENGTH 5 - -#define USB_PRODUCT_NAME {'T'<<8, 'u'<<8, 'x'<<8, 'D'<<8, \ - 'r'<<8, 'o'<<8, 'i'<<8, 'd'<<8} -#define USB_PN_LENGTH 8 - -#define USB_SERIAL_NUMBER {'1'<<8, '0'<<8, '0'<<8, '0'<<8, '1'<<8} -#define USB_SN_LENGTH 5 - -#define USB_CONFIG_NAME {'T'<<8, 'u'<<8, 'x'<<8, 'D'<<8, \ - 'r'<<8, 'o'<<8, 'i'<<8, 'd'<<8} -#define USB_CONFIG_LENGTH 8 - -#define AUDIO_NORMAL_NAME {'T'<<8, 'u'<<8, 'x'<<8, 'D'<<8, \ - 'r'<<8, 'o'<<8, 'i'<<8, 'd'<<8, '-'<<8, 'A'<<8, 'u'<<8, 'd'<<8, \ - 'i'<<8, 'o'<<8} -#define AUDIO_NORMAL_LENGTH 14 - -#define AUDIO_SPEAKER_NAME {'T'<<8, 'u'<<8, 'x'<<8, 'D'<<8, \ - 'r'<<8, 'o'<<8, 'i'<<8, 'd'<<8, '-'<<8, 'S'<<8, 'p'<<8, 'e'<<8, \ - 'a'<<8, 'k'<<8,'e'<<8,'r'<<8} -#define AUDIO_SPEAKER_LENGTH 16 - - -#define AUDIO_MICRO_NAME {'T'<<8, 'u'<<8, 'x'<<8, 'D'<<8, \ - 'r'<<8, 'o'<<8, 'i'<<8, 'd'<<8, '-'<<8, 'M'<<8, 'i'<<8, 'c'<<8, \ - 'r'<<8, 'o'<<8} -#define AUDIO_MICRO_LENGTH 14 - - -#define AUDIO_TTS_NAME {'T'<<8, 'u'<<8, 'x'<<8, 'D'<<8, \ - 'r'<<8, 'o'<<8, 'i'<<8, 'd'<<8, '-'<<8, 'T'<<8, 'T'<<8, 'S'<<8} -#define AUDIO_TTS_LENGTH 12 - -#define LANG_ID 0x00 -#define LANGUAGE_ID 0x0904 #endif // _CONFIG_H_ Modified: firmware/fuxusb/trunk/src/global.c =================================================================== --- firmware/fuxusb/trunk/src/global.c 2008-05-20 12:25:48 UTC (rev 1178) +++ firmware/fuxusb/trunk/src/global.c 2008-05-20 12:59:06 UTC (rev 1179) @@ -17,10 +17,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id:$ */ +/* $Id$ */ +#include "global.h" #include "config.h" -#include "global.h" #include "version.h" uint8_t Command_Ctr; Modified: firmware/fuxusb/trunk/src/global.h =================================================================== --- firmware/fuxusb/trunk/src/global.h 2008-05-20 12:25:48 UTC (rev 1178) +++ firmware/fuxusb/trunk/src/global.h 2008-05-20 12:59:06 UTC (rev 1179) @@ -139,7 +139,6 @@ * \defgroup mcu MCU libs */ - #include "common\api.h" #include "common\defines.h" @@ -169,10 +168,28 @@ extern code author_t info_author; -#define wait_reset() \ -{\ -WDTRST = 0x1E; \ -WDTRST = 0xE1; \ -while(1); \ -} +/** + * \brief Reset the dongle. + * This function configure the watchdog timer and wait the timer OVF. + * \ingroup misc + */ +#define wait_reset() {\ + WDTRST = 0x1E; \ + WDTRST = 0xE1; \ + while(1); \ + } + +/** + * \brief reattach USB. + * This function simulate a disconnexion/connexion of the USB device. + * This is used when the device has to be re-enumerated (ISP mode for example). + * \ingroup usb_misc + */ +#define reattach_usb() { \ + long tc; \ + tc=10000; \ + Usb_detach(); \ + while(tc) tc --; \ + Usb_attach(); \ + } #endif // _GLOBAL_H_ Modified: firmware/fuxusb/trunk/src/usb_commands.c =================================================================== --- firmware/fuxusb/trunk/src/usb_commands.c 2008-05-20 12:25:48 UTC (rev 1178) +++ firmware/fuxusb/trunk/src/usb_commands.c 2008-05-20 12:59:06 UTC (rev 1179) @@ -28,7 +28,6 @@ #include "global.h" #include "usb_ep.h" #include "usb_commands.h" -#include "usb_misc.h" #include "spi_task.h" #include "bootloader.h" #include "fifo_stt.h" Modified: firmware/fuxusb/trunk/src/usb_desc.h =================================================================== --- firmware/fuxusb/trunk/src/usb_desc.h 2008-05-20 12:25:48 UTC (rev 1178) +++ firmware/fuxusb/trunk/src/usb_desc.h 2008-05-20 12:59:06 UTC (rev 1179) @@ -27,9 +27,11 @@ #ifndef _USB_DESC_H_ #define _USB_DESC_H_ -#include "config.h" #include "version.h" +/** Enable the HID interface */ +#undef HID_DEVICE + /** \name Descriptors type * @{ */ /** \name Standard descriptors @@ -100,7 +102,121 @@ /*! @} */ /*! @} */ +/** \name Strings + * @{ */ +/** \name Manufacturer + * @{ */ +#define MAN_STRING_INDEX 1 +#define USB_MANUFACTURER_NAME {'K'<<8, 'y'<<8, 's'<<8, 'o'<<8, 'h'<<8} +#define USB_MN_LENGTH 5 +/* @} */ +/** \name Product + * @{ */ +#define PROD_STRING_INDEX 2 +#define USB_PRODUCT_NAME {'T'<<8, 'u'<<8, 'x'<<8, 'D'<<8, \ + 'r'<<8, 'o'<<8, 'i'<<8, 'd'<<8} +#define USB_PN_LENGTH 8 +/* @} */ + +/** \name Serial number + * @{ */ +#define SN_STRING_INDEX 3 +#define USB_SERIAL_NUMBER {'1'<<8, '0'<<8, '0'<<8, '0'<<8, '1'<<8} +#define USB_SN_LENGTH 5 +/* @} */ + +/** \name Configuration + * @{ */ +#define CONFIG_STRING_INDEX 4 +#define USB_CONFIG_NAME {'T'<<8, 'u'<<8, 'x'<<8, 'D'<<8, \ + 'r'<<8, 'o'<<8, 'i'<<8, 'd'<<8} +#define USB_CONFIG_LENGTH 8 +/* @} */ + +/** \name Speaker interface + * @{ */ +#define AUDIO_SPEAKER_INDEX 5 +#define AUDIO_SPEAKER_NAME {'T'<<8, 'u'<<8, 'x'<<8, 'D'<<8, \ + 'r'<<8, 'o'<<8, 'i'<<8, 'd'<<8, '-'<<8, 'S'<<8, 'p'<<8, 'e'<<8, \ + 'a'<<8, 'k'<<8,'e'<<8,'r'<<8} +#define AUDIO_SPEAKER_LENGTH 16 +/* @} */ + +/** \name Microphone interface + * @{ */ +#define AUDIO_MICRO_INDEX 6 +#define AUDIO_MICRO_NAME {'T'<<8, 'u'<<8, 'x'<<8, 'D'<<8, \ + 'r'<<8, 'o'<<8, 'i'<<8, 'd'<<8, '-'<<8, 'M'<<8, 'i'<<8, 'c'<<8, \ + 'r'<<8, 'o'<<8} +#define AUDIO_MICRO_LENGTH 14 +/* @} */ + +/** \name TTS interface + * @{ */ +#define AUDIO_TTS_INDEX 7 +#define AUDIO_TTS_NAME {'T'<<8, 'u'<<8, 'x'<<8, 'D'<<8, \ + 'r'<<8, 'o'<<8, 'i'<<8, 'd'<<8, '-'<<8, 'T'<<8, 'T'<<8, 'S'<<8} +#define AUDIO_TTS_LENGTH 12 +/* @} */ + +/** \name Normal audio control interface + * @{ */ +#define AUDIO_NORMAL_INDEX 8 +#define AUDIO_NORMAL_NAME {'T'<<8, 'u'<<8, 'x'<<8, 'D'<<8, \ + 'r'<<8, 'o'<<8, 'i'<<8, 'd'<<8, '-'<<8, 'A'<<8, 'u'<<8, 'd'<<8, \ + 'i'<<8, 'o'<<8} +#define AUDIO_NORMAL_LENGTH 14 +/* @} */ +/* @} */ + + + +/** \name USB configuration + * @{ */ + + +/** \name Device specifications and classes + * @} */ +#define USB_SPECIFICATION 0x1001 +#define DEVICE_CLASS 0x00 +#define DEVICE_SUB_CLASS 0 +#define DEVICE_PROTOCOL 0 +#define EP_CONTROL_LENGTH 32 +#define NB_CONFIGURATION 1 +/* @} */ + +/** \name Version - PID/VID + * @{ */ +#define VENDOR_ID 0xEB03 /* Atmel vendor ID = 03EBh */ +#define PRODUCT_ID 0x07FF /* Product ID: FF07h*/ +#define RELEASE_NUMBER (0x0100*VER_UPDATE) + (0x1000*VER_MINOR) +\ + (0x0001*VER_MAJOR) +/* @} */ + +/** \name Configuration descriptor + * @{ */ +#ifdef HID_DEVICE +# define SIZE_OF_REPORT 0x22 +# define CONF_LENGTH 0x2901 // 297 +# define NB_INTERFACE 6 +#else +# define CONF_LENGTH 0x2001 // 288 +# define NB_INTERFACE 6 +#endif + +#define CONF_NB 1 +#define CONF_ATTRIBUTES USB_CONFIG_BUSPOWERED +#define MAX_POWER 50 /* 100 mA */ +/* @} */ + +/** \name Languages + * @{ */ +#define LANG_ID 0x00 +#define LANGUAGE_ID 0x0904 +/* @} */ +/* @} */ + struct usb_st_device_descriptor { uint8_t bLength; /* Size of this descriptor in bytes */ Modified: firmware/fuxusb/trunk/src/usb_misc.c =================================================================== --- firmware/fuxusb/trunk/src/usb_misc.c 2008-05-20 12:25:48 UTC (rev 1178) +++ firmware/fuxusb/trunk/src/usb_misc.c 2008-05-20 12:59:06 UTC (rev 1179) @@ -69,20 +69,3 @@ FIFO_STT_init(); } -/** - * \brief reattach USB. - * This function simulate a disconnexion/connexion of the USB device. - * This is used when the device has to be re-enumerated (ISP mode for example). - * \ingroup usb_misc - */ -void reattach_usb(void) -{ - long tc; - - tc=10000; - Usb_detach(); - while(tc) tc --; - Usb_attach(); -} - - Modified: firmware/fuxusb/trunk/src/usb_misc.h =================================================================== --- firmware/fuxusb/trunk/src/usb_misc.h 2008-05-20 12:25:48 UTC (rev 1178) +++ firmware/fuxusb/trunk/src/usb_misc.h 2008-05-20 12:59:06 UTC (rev 1179) @@ -30,7 +30,6 @@ void suspend_usb(void); void resume_usb(void); void reset_usb(void); -void reattach_usb(void); #endif // _USB_MISC_H_ |
From: Paul_R <c2m...@c2...> - 2008-05-20 12:26:01
|
Author: Paul_R Date: 2008-05-20 14:25:48 +0200 (Tue, 20 May 2008) New Revision: 1178 Modified: firmware/fuxusb/trunk/src/global.h firmware/fuxusb/trunk/src/misc.c firmware/fuxusb/trunk/src/misc.h firmware/fuxusb/trunk/src/usb_commands.c Log: * Removed the wait_reset function, and replace it by a define in global.h Modified: firmware/fuxusb/trunk/src/global.h =================================================================== --- firmware/fuxusb/trunk/src/global.h 2008-05-20 10:07:01 UTC (rev 1177) +++ firmware/fuxusb/trunk/src/global.h 2008-05-20 12:25:48 UTC (rev 1178) @@ -168,4 +168,11 @@ extern code revision_t info_revision; extern code author_t info_author; + +#define wait_reset() \ +{\ +WDTRST = 0x1E; \ +WDTRST = 0xE1; \ +while(1); \ +} #endif // _GLOBAL_H_ Modified: firmware/fuxusb/trunk/src/misc.c =================================================================== --- firmware/fuxusb/trunk/src/misc.c 2008-05-20 10:07:01 UTC (rev 1177) +++ firmware/fuxusb/trunk/src/misc.c 2008-05-20 12:25:48 UTC (rev 1178) @@ -66,17 +66,3 @@ usb_sof_counter = 0; } } - - -/** - * \brief Reset the dongle. - * This function configure the watchdog timer and wait the timer OVF. - * \ingroup misc - */ -void wait_reset(void) -{ - /* Configure watchdog reset */ - WDTRST = 0x1E; - WDTRST = 0xE1; - while(1); -} Modified: firmware/fuxusb/trunk/src/misc.h =================================================================== --- firmware/fuxusb/trunk/src/misc.h 2008-05-20 10:07:01 UTC (rev 1177) +++ firmware/fuxusb/trunk/src/misc.h 2008-05-20 12:25:48 UTC (rev 1178) @@ -29,6 +29,5 @@ void led_behavior(void); -void wait_reset(void); #endif // _MISC_H_ Modified: firmware/fuxusb/trunk/src/usb_commands.c =================================================================== --- firmware/fuxusb/trunk/src/usb_commands.c 2008-05-20 10:07:01 UTC (rev 1177) +++ firmware/fuxusb/trunk/src/usb_commands.c 2008-05-20 12:25:48 UTC (rev 1178) @@ -32,7 +32,6 @@ #include "spi_task.h" #include "bootloader.h" #include "fifo_stt.h" -#include "misc.h" #include "rf.h" #include "lib_mcu\fa-usb\flash_api.h" #include "lib_mcu\usb\usb_drv.h" |
From: Paul_R <c2m...@c2...> - 2008-05-20 10:07:05
|
Author: Paul_R Date: 2008-05-20 12:07:01 +0200 (Tue, 20 May 2008) New Revision: 1177 Modified: firmware/fuxusb/trunk/src/bootloader.c firmware/fuxusb/trunk/src/bootloader.h firmware/fuxusb/trunk/src/global.h firmware/fuxusb/trunk/src/i2c.c firmware/fuxusb/trunk/src/i2c.h firmware/fuxusb/trunk/src/lib_mcu/twi/twi.h firmware/fuxusb/trunk/src/misc.c firmware/fuxusb/trunk/src/misc.h firmware/fuxusb/trunk/src/rf.c firmware/fuxusb/trunk/src/rf.h firmware/fuxusb/trunk/src/spi_task.c firmware/fuxusb/trunk/src/spi_task.h firmware/fuxusb/trunk/src/usb_commands.c Log: * Added comments. Modified: firmware/fuxusb/trunk/src/bootloader.c =================================================================== --- firmware/fuxusb/trunk/src/bootloader.c 2008-05-20 09:28:43 UTC (rev 1176) +++ firmware/fuxusb/trunk/src/bootloader.c 2008-05-20 10:07:01 UTC (rev 1177) @@ -19,19 +19,19 @@ /* $Id$ */ +/** \file bootloader.c + \brief bootloader functions. + \ingroup bootloader +*/ + #include "config.h" #include "global.h" #include "usb_commands.h" -#include "usb_ep.h" #include "bootloader.h" #include "i2c.h" #include "spi_task.h" #include "rf.h" -#include "fifo_stt.h" -#include "lib_mcu\usb\usb_drv.h" - - /* Externs defs */ bit i2c_bootloading_Flag; @@ -50,7 +50,11 @@ static void init_bootloader(void); static void bl_senddata(blHeader_t blHeader, uint8_t dataLength); - +/** + * \brief Bootloader commands parser. + * This function analyze the commands received. + * \ingroup bootloader + */ void bootloader_cmd_parser(void) { /* Disable spi_task */ @@ -117,6 +121,12 @@ } } + +/** + * \brief I2C task. + * This function send the data on the I2C bus. + * \ingroup bootloader + */ void i2c_task(void) { if (i2c_wait_counter) @@ -143,6 +153,12 @@ } } + +/** + * \brief Fill page + * A new page has been received. Check if the page is good, control the indexes + * and adresses, and put the data on the i2c. + */ static void bl_fill_page(void) { uint8_t i; @@ -199,7 +215,9 @@ packet_idx++; } - +/** + * \brief Init bootloader mode. + */ static void init_bootloader(void) { /* Configure I2C wait counter */ @@ -230,7 +248,7 @@ } /** - *\brief Exit bootloader mode + *\brief Exit bootloader mode. */ static void bl_exit(void) { @@ -243,7 +261,7 @@ /* - * Initialize i2c interface + * Initialize i2c interface. */ static void bl_init(void) { @@ -255,8 +273,8 @@ blHeader.blData = &i2cSendData[2]; } -/* - * Sends the data stored in i2cSendData array. Only the +/*! + * \brief Sends the data stored in i2cSendData array. Only the * 'dataLength' first bytes are sent. * * Prepare the i2c communication and store the page address in the Modified: firmware/fuxusb/trunk/src/bootloader.h =================================================================== --- firmware/fuxusb/trunk/src/bootloader.h 2008-05-20 09:28:43 UTC (rev 1176) +++ firmware/fuxusb/trunk/src/bootloader.h 2008-05-20 10:07:01 UTC (rev 1177) @@ -19,15 +19,22 @@ /* $Id$ */ +/** \file bootloader.h + \brief Bootloader header. + \ingroup bootloader +*/ + #ifndef _BOOTLOADER_H_ #define _BOOTLOADER_H_ -/** USB bootloader commands */ +/** \name USB bootloader commands + * @{ */ #define BOOT_INIT 1 #define BOOT_FILLPAGE 2 #define BOOT_EXIT 3 #define BOOTLOADER_CMD (uint8_t)0xF0 /* Bootloader status command */ +/* @} */ /** * \brief Bootloading header structure which holds all information to initiate Modified: firmware/fuxusb/trunk/src/global.h =================================================================== --- firmware/fuxusb/trunk/src/global.h 2008-05-20 09:28:43 UTC (rev 1176) +++ firmware/fuxusb/trunk/src/global.h 2008-05-20 10:07:01 UTC (rev 1177) @@ -73,6 +73,22 @@ * \ingroup fuxusb */ +/** \defgroup spi_task SPI task + * \brief SPI communication. + * \ingroup fuxusb + */ + + +/** \defgroup bootloader Bootloader + * \brief Bootloader functions. + * \ingroup fuxusb + */ + +/** \defgroup i2c I2C + * \brief I2C functions. + * \ingroup fuxusb + */ + /** * \defgroup fifo_spk Speaker FIFO \brief FIFO_SPK is used for the speaker data, received from the USB and sent @@ -85,6 +101,7 @@ \ingroup fuxusb */ + /** * \defgroup fifo_mic Microphone FIFO \brief FIFO_MIC used for the microphone data, received from the RF and sent @@ -96,7 +113,7 @@ \ingroup fuxusb */ - /** +/** * \defgroup fifo_stt Status FIFO \brief FIFO_STT is used for the status data, received from the RF and sent to the computer. @@ -107,8 +124,22 @@ \ingroup fuxusb */ + +/** \defgroup rf RF + * \brief RF functions. + * \ingroup fuxusb + */ +/** \defgroup misc Misc + * \brief Misc functions. + * \ingroup fuxusb + */ +/** + * \defgroup mcu MCU libs + */ + + #include "common\api.h" #include "common\defines.h" Modified: firmware/fuxusb/trunk/src/i2c.c =================================================================== --- firmware/fuxusb/trunk/src/i2c.c 2008-05-20 09:28:43 UTC (rev 1176) +++ firmware/fuxusb/trunk/src/i2c.c 2008-05-20 10:07:01 UTC (rev 1177) @@ -17,8 +17,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id:$ */ +/* $Id$ */ +/** \file i2c.c + \ingroup i2c +*/ + #include "i2c.h" /* I2C status and address variables */ @@ -44,8 +48,9 @@ /* functions */ -/* - * Set the TWI transaction bitrate +/** + * \brief Set the TWI transaction bitrate + * \ingroup i2c */ void i2cSetBitrate(void) { @@ -53,12 +58,13 @@ SSCON = TWI_SCAL_VALUE; /* twi intialisation */ } -/* - * This function initializes the TWI interface for i2c communication. You - * should use the definitions in i2c.h to select the mode you want. +/*! + * \brief This function initializes the TWI interface for i2c communication. + * You should use the definitions in i2c.h to select the mode you want. * * Note that you should set the i2cSlaveReceive and i2cSlaveTransmit handlers * after this initialization otherwise they'll be cleared. + * \ingroup i2c */ void i2cInit(void) { @@ -82,20 +88,26 @@ #endif } -/* Set the user function which handles receiving (incoming) data as a slave */ +/** \brief Set the user function which handles receiving (incoming) data as a slave. + * \ingroup i2c + */ void i2cSetSlaveReceiveHandler(void (*i2cSlaveRx_func)(uint8_t receiveDataLength, uint8_t* recieveData)) { i2cSlaveReceive = i2cSlaveRx_func; } -/* Set the user function which handles transmitting (outgoing) data as a slave */ +/** \brief Set the user function which handles transmitting (outgoing) data as a slave. + * \ingroup i2c + */ void i2cSetSlaveTransmitHandler(uint8_t (*i2cSlaveTx_func)(uint8_t transmitDataLengthMax, uint8_t* transmitData)) { i2cSlaveTransmit = i2cSlaveTx_func; } void i2cSendStart(void); -/* Start a Master transmission, i2cSendDataIndex is reset automatically here */ +/** \brief Start a Master transmission, i2cSendDataIndex is reset automatically here. + * \ingroup i2c + */ void i2cMasterStart(void) { i2cFlags.i2c_busy = 1; @@ -103,45 +115,52 @@ i2cSendStart(); } +/** \brief Send start command */ void i2cSendStart(void) { TWI_SET_START(); } +/** \brief Send stop command */ void i2cSendStop(void) { TWI_SET_STOP(); i2cFlags.i2c_busy = 0; } +/** \brief Send byte */ void i2cSendByte(uint8_t _data) { SSDAT = _data; } +/** \brief Acknoledge the received byte */ void i2cAckReceiveByte(void) { TWI_SET_AA(); } +/** \brief NACK the received byte */ void i2cNackReceiveByte(void) { TWI_CLEAR_AA(); } #define TW_DATA SSDAT +/** \brief Get received byte */ uint8_t i2cGetReceivedByte(void) { return SSDAT; } +/** \brief Get status */ uint8_t i2cGetStatus(void) { return TW_STATUS; } -/* TWI interrupt service routine */ +/** \brief TWI interrupt service routine */ #ifdef TWI_INT_ENABLED void it_TWI(void) interrupt IRQ_TWI using 1 { Modified: firmware/fuxusb/trunk/src/i2c.h =================================================================== --- firmware/fuxusb/trunk/src/i2c.h 2008-05-20 09:28:43 UTC (rev 1176) +++ firmware/fuxusb/trunk/src/i2c.h 2008-05-20 10:07:01 UTC (rev 1177) @@ -19,6 +19,10 @@ /* $Id$ */ +/** \file i2c.h + \ingroup i2c +*/ + #ifndef _I2C_H_ #define _I2C_H_ @@ -40,8 +44,11 @@ * Choose operation mode, comment/uncomment lines * For Slave only operation, choose Master and Slave */ +/** \name Operation modes + * @{ */ #define TWI_INT_ENABLED /* comment if you don't want twi interrupts */ #define TWI_M_ENABLED /* comment if you don't want twi master mode */ +/* @} */ //#define TWI_SLA_ENABLED /* comment if you don't want twi slave mode */ /* SSADR: TWI (Slave) Address Register @@ -85,7 +92,7 @@ /*! defines and constants */ #define TWCR_CMD_MASK 0x0F -/* +/** * Bits that are set inside interrupt routines, and watched outside in * the program's main loop. */ Modified: firmware/fuxusb/trunk/src/lib_mcu/twi/twi.h =================================================================== --- firmware/fuxusb/trunk/src/lib_mcu/twi/twi.h 2008-05-20 09:28:43 UTC (rev 1176) +++ firmware/fuxusb/trunk/src/lib_mcu/twi/twi.h 2008-05-20 10:07:01 UTC (rev 1177) @@ -1,4 +1,4 @@ -/* $Id:$ */ +/* $Id$ */ #ifndef _LIBMCU_TWI_H_ #define _LIBMCU_TWI_H_ 1 @@ -36,6 +36,7 @@ This header file contains bit mask definitions for use with the ATMEL TWI interface. + \ingroup mcu */ /** \name TWSR values Modified: firmware/fuxusb/trunk/src/misc.c =================================================================== --- firmware/fuxusb/trunk/src/misc.c 2008-05-20 09:28:43 UTC (rev 1176) +++ firmware/fuxusb/trunk/src/misc.c 2008-05-20 10:07:01 UTC (rev 1177) @@ -18,12 +18,25 @@ */ /* $Id$ */ + + +/** \file misc.c + \ingroup misc +*/ + #include "config.h" #include "global.h" #include "misc.h" static uint16_t usb_sof_counter = 0; +/** + * \brief Control the LED behavior. + * The LED blink slowly when the RF is disconnected, and fast when Tux is + * connected. + * The timebase is the USB start of frame each 1ms. + * \ingroup misc + */ void led_behavior(void) { usb_sof_counter ++; @@ -54,6 +67,12 @@ } } + +/** + * \brief Reset the dongle. + * This function configure the watchdog timer and wait the timer OVF. + * \ingroup misc + */ void wait_reset(void) { /* Configure watchdog reset */ Modified: firmware/fuxusb/trunk/src/misc.h =================================================================== --- firmware/fuxusb/trunk/src/misc.h 2008-05-20 09:28:43 UTC (rev 1176) +++ firmware/fuxusb/trunk/src/misc.h 2008-05-20 10:07:01 UTC (rev 1177) @@ -19,6 +19,11 @@ /* $Id$ */ + +/** \file misc.h + \ingroup misc +*/ + #ifndef _MISC_H_ #define _MISC_H_ Modified: firmware/fuxusb/trunk/src/rf.c =================================================================== --- firmware/fuxusb/trunk/src/rf.c 2008-05-20 09:28:43 UTC (rev 1176) +++ firmware/fuxusb/trunk/src/rf.c 2008-05-20 10:07:01 UTC (rev 1177) @@ -17,15 +17,19 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id:$ */ +/* $Id$ */ +/** \file rf.c + \ingroup rf + */ #include "config.h" #include "global.h" #include "spi_lib.h" #include "rf.h" /** - *\brief Restart the RF. + * \brief Restart the RF. + * \ingroup rf */ void reset_rf(void) { @@ -38,7 +42,8 @@ } /** - * Restart the RF in bootloader mode + * \brief Restart the RF in bootloader mode. + * \ingroup rf */ void rf_start_bootloader(void) { Modified: firmware/fuxusb/trunk/src/rf.h =================================================================== --- firmware/fuxusb/trunk/src/rf.h 2008-05-20 09:28:43 UTC (rev 1176) +++ firmware/fuxusb/trunk/src/rf.h 2008-05-20 10:07:01 UTC (rev 1177) @@ -17,8 +17,13 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id:$ */ +/* $Id$ */ + +/** \file rf.h + \ingroup rf +*/ + #ifndef _RF_H_ #define _RF_H_ Modified: firmware/fuxusb/trunk/src/spi_task.c =================================================================== --- firmware/fuxusb/trunk/src/spi_task.c 2008-05-20 09:28:43 UTC (rev 1176) +++ firmware/fuxusb/trunk/src/spi_task.c 2008-05-20 10:07:01 UTC (rev 1177) @@ -19,18 +19,21 @@ /* $Id$ */ +/** \file spi_task.c + \brief SPI task functions. + \ingroup spi_task +*/ + #include "global.h" #include "config.h" -#include "usb_task.h" #include "spi_lib.h" #include "spi_task.h" -#include "global.h" #include "fifo_spk.h" #include "fifo_mic.h" #include "fifo_stt.h" -/* - * spi_slave enum define the steps of the SPI frame. +/** + * \brief spi_slave enum define the steps of the SPI frame. */ enum { @@ -41,7 +44,7 @@ } spi_slave; /* - * spi_master enum define the steps of the SPI frame. + * \brief spi_master enum define the steps of the SPI frame. */ enum { @@ -69,6 +72,8 @@ /** * \brief Reset the SPI task to the defaults states. + * This function reset all SPI variables. + * \ingroup spi_task */ void spi_task_reset(void) { @@ -84,6 +89,7 @@ /** * \brief Init the SPI transaction. * This function init the SPI bus and the INT0 interrupt. + * \ingroup spi_task */ void spi_task_init(void) { @@ -126,6 +132,7 @@ * \brief INT0 interrupt. * This interrupt is trigged when a falling edge on P3_2. * spi_ready is set to indicate that a new spi transaction can begin. + * \ingroup spi_task */ void it_INT0(void) interrupt IRQ_INT0 { @@ -135,6 +142,7 @@ /** * \brief SPI task main function. * The SPI protocol must be refactored soon. So, I don't change this function ATM. + * \ingroup spi_task */ void spi_task(void) { Modified: firmware/fuxusb/trunk/src/spi_task.h =================================================================== --- firmware/fuxusb/trunk/src/spi_task.h 2008-05-20 09:28:43 UTC (rev 1176) +++ firmware/fuxusb/trunk/src/spi_task.h 2008-05-20 10:07:01 UTC (rev 1177) @@ -19,6 +19,11 @@ /* $Id$ */ +/** \file spi_task.h + \brief SPI task header. + \ingroup spi_task +*/ + #ifndef _SPITASK_H_ #define _SPITASK_H_ Modified: firmware/fuxusb/trunk/src/usb_commands.c =================================================================== --- firmware/fuxusb/trunk/src/usb_commands.c 2008-05-20 09:28:43 UTC (rev 1176) +++ firmware/fuxusb/trunk/src/usb_commands.c 2008-05-20 10:07:01 UTC (rev 1177) @@ -27,8 +27,8 @@ #include "config.h" #include "global.h" #include "usb_ep.h" +#include "usb_commands.h" #include "usb_misc.h" -#include "usb_commands.h" #include "spi_task.h" #include "bootloader.h" #include "fifo_stt.h" |
From: Paul_R <c2m...@c2...> - 2008-05-20 09:29:05
|
Author: Paul_R Date: 2008-05-20 11:28:43 +0200 (Tue, 20 May 2008) New Revision: 1176 Modified: firmware/fuxusb/trunk/src/config.h firmware/fuxusb/trunk/src/global.h firmware/fuxusb/trunk/src/usb_commands.c firmware/fuxusb/trunk/src/usb_commands.h firmware/fuxusb/trunk/src/usb_desc.c firmware/fuxusb/trunk/src/usb_desc.h firmware/fuxusb/trunk/src/usb_enum.c firmware/fuxusb/trunk/src/usb_enum.h firmware/fuxusb/trunk/src/usb_ep.c firmware/fuxusb/trunk/src/usb_ep.h firmware/fuxusb/trunk/src/usb_misc.c firmware/fuxusb/trunk/src/usb_misc.h Log: * Finished to comment the USB modules. Modified: firmware/fuxusb/trunk/src/config.h =================================================================== --- firmware/fuxusb/trunk/src/config.h 2008-05-19 11:02:54 UTC (rev 1175) +++ firmware/fuxusb/trunk/src/config.h 2008-05-20 09:28:43 UTC (rev 1176) @@ -30,7 +30,7 @@ #include <stdio.h> /* Enable the HID interface */ -//#define HID_DEVICE +#define HID_DEVICE /* Debug modes : Don't forget to define MAIN_DEBUG to be able to use printf */ //#define MAIN_DEBUG Modified: firmware/fuxusb/trunk/src/global.h =================================================================== --- firmware/fuxusb/trunk/src/global.h 2008-05-19 11:02:54 UTC (rev 1175) +++ firmware/fuxusb/trunk/src/global.h 2008-05-20 09:28:43 UTC (rev 1176) @@ -22,10 +22,16 @@ #ifndef _GLOBAL_H_ #define _GLOBAL_H_ +/** \mainpage Fuxusb firmware documentation of the Tux Droid open source robot + * + * \section SVN SVN repository + * http://svn.tuxisalive.com/firmware/fuxusb/trunk + */ + /** \defgroup fuxusb USB Dongle for TuxDroid. */ - /** \defgroup main Main function. + /** \defgroup main Main function * \brief Fuxusb main function * \ingroup fuxusb */ @@ -39,20 +45,36 @@ /** * \defgroup usb_enum USB enumeration process - \brief This module analyse the enumeration requests and send back required + \brief This module analyze the enumeration requests and send back required informations. \ingroup fuxusb */ -/** \mainpage Fuxusb firmware documentation of the Tux Droid open source robot - * - * \section SVN SVN repository - * http://svn.tuxisalive.com/firmware/fuxusb/trunk +/** + * \defgroup usb_desc USB descriptor + \brief This module contain the descriptors structures. + + \ingroup fuxusb */ +/** \defgroup usb_ep USB Endpoints + * \brief Endpoints control. + * \ingroup fuxusb + */ + + +/** \defgroup usb_cmd USB commands + * \brief Functions to prepare status and parse received commands. + * \ingroup fuxusb + */ + +/** \defgroup usb_misc USB misc functions + * \ingroup fuxusb + */ + /** - * \defgroup fifo_spk Speaker FIFO. + * \defgroup fifo_spk Speaker FIFO \brief FIFO_SPK is used for the speaker data, received from the USB and sent to the RF. @@ -64,11 +86,10 @@ */ /** - * \defgroup fifo_mic Microphone FIFO. + * \defgroup fifo_mic Microphone FIFO \brief FIFO_MIC used for the microphone data, received from the RF and sent to the computer. - - This FIFO are specific for this application and the context. + This FIFO is specific for this application and the context. It's optimized for speed. It's not circular, and the access to the buffer are direct. @@ -76,7 +97,7 @@ */ /** - * \defgroup fifo_stt Status FIFO. + * \defgroup fifo_stt Status FIFO \brief FIFO_STT is used for the status data, received from the RF and sent to the computer. Modified: firmware/fuxusb/trunk/src/usb_commands.c =================================================================== --- firmware/fuxusb/trunk/src/usb_commands.c 2008-05-19 11:02:54 UTC (rev 1175) +++ firmware/fuxusb/trunk/src/usb_commands.c 2008-05-20 09:28:43 UTC (rev 1176) @@ -19,6 +19,11 @@ /* $Id$ */ +/** \file usb_commands.c + \brief USB commands functions. + \ingroup usb_cmd +*/ + #include "config.h" #include "global.h" #include "usb_ep.h" @@ -38,7 +43,10 @@ static void reset_dongle(void); /** - * \brief Parse the received command + * \brief Parse the received command. + * This function analyse the commands, and determine if it's a Tux, dongle or + * bootloader command. + * \ingroup usb_cmd */ void commands_parser(void) { @@ -84,6 +92,7 @@ /** *\brief Fill the USB EP Fifo with statuses. * This function prepare the USB EP Fifo with the lasts statuses received. + * \ingroup usb_cmd */ void prepare_status(void) { @@ -123,10 +132,11 @@ } } -/* - * Acknowledge or not a bootloader command. +/** + * \brief Acknowledge or not a bootloader command. * \param ack Send an ACK if ack is set, NACK otherwise * \param p1, p2, p3: optional paramaters + * \ingroup usb_cmd */ void bl_acknowledge(uint8_t ack, uint8_t p1, uint8_t p2, uint8_t p3) { @@ -147,8 +157,9 @@ send_status(); } -/* +/** * \brief Parse commands for dongle. + * This function parse the commands for dongle. */ static void dongle_cmd_parser(void) { @@ -215,6 +226,8 @@ /** *\brief Perform a complete reset. + * This function reset the dongle. To do this, the watchdog timer is configured + * and started, and an infinite loop wait the reset. */ static void reset_dongle(void) { Modified: firmware/fuxusb/trunk/src/usb_commands.h =================================================================== --- firmware/fuxusb/trunk/src/usb_commands.h 2008-05-19 11:02:54 UTC (rev 1175) +++ firmware/fuxusb/trunk/src/usb_commands.h 2008-05-20 09:28:43 UTC (rev 1176) @@ -19,29 +19,58 @@ /* $Id$ */ +/** \file usb_commands.h + \brief USB commands header. + \ingroup usb_cmd +*/ + #ifndef _USB_COMMANDS_H_ #define _USB_COMMANDS_H_ +/** \name Commands type + * @{ */ +/** Commands for Tux */ #define TUX_CMD_HDR 0 +/** Commands for the dongle */ #define DONGLE_CMD_HDR 1 +/** Commands for the bootloader */ #define BOOTLOADER_CMD_HDR 2 +/* @} */ +/** \name Commands sub-type + * @{ */ +/** \name Commands sub-types for the dongle + * @{ */ +/** Maintenance */ #define DONGLE_CMD 1 +/** Audio */ #define TTS_CMD 2 +/* @} */ +/* @} */ +/** \name Maintenance commands sub-type + * @{ */ +/** New status request */ #define STATUS_REQUEST 0x00 +/** RF reset request */ #define RF_RESET 0xFD +/** Dongle reset request */ #define USB_RESET 0xFE +/** Jump ISP mode request */ #define ISP_MODE 0xFF +/* @} */ - +/** \name Audio commands sub-type + * @{ */ +/** Switch to normal audio pipe */ #define TTS_OFF 0 +/** Switch to TTS audio pipe */ #define TTS_ON 1 +/* @} */ /* Functions */ void bl_acknowledge(uint8_t ack, uint8_t p1, uint8_t p2, uint8_t p3); void commands_parser(void); void prepare_status(void); -void bl_send_ack(void); #endif // _USB_COMMANDS_H_ Modified: firmware/fuxusb/trunk/src/usb_desc.c =================================================================== --- firmware/fuxusb/trunk/src/usb_desc.c 2008-05-19 11:02:54 UTC (rev 1175) +++ firmware/fuxusb/trunk/src/usb_desc.c 2008-05-20 09:28:43 UTC (rev 1176) @@ -19,10 +19,17 @@ /* $Id$ */ +/** \file usb_desc.c + \brief Structures and variable for the descriptors + \ingroup usb_desc +*/ + #include "config.h" #include "usb_desc.h" - +/** \brief Device descriptor. + * This descriptor inform host about the device. + */ code struct usb_st_device_descriptor usb_device_descriptor = { sizeof(usb_device_descriptor), DEVICE, USB_SPECIFICATION, DEVICE_CLASS, @@ -31,34 +38,79 @@ SN_STRING_INDEX, NB_CONFIGURATION }; +/** \brief Manufactrer string. + * Contain the manufacturer string + * string : KYSOH + * size : 5 + */ code struct usb_st_manufacturer usb_manufacturer = { sizeof(usb_manufacturer), STRING, USB_MANUFACTURER_NAME }; +/** \brief Product string. + * Contain the product string + * string : TuxDroid + * size : 8 + */ code struct usb_st_product usb_product = { sizeof(usb_product), STRING, USB_PRODUCT_NAME }; + +/** \brief Serial number. + * string : 10001 + * size : 5 + */ code struct usb_st_serial_number usb_serial_number = { sizeof(usb_serial_number), STRING, USB_SERIAL_NUMBER }; + +/** \brief Language code. + * Define the language + * string : 0x0904 + */ code struct usb_st_language_descriptor usb_language = { sizeof(usb_language), STRING, LANGUAGE_ID }; + +/** \brief Configuration string. + * Contain the configuration name + * string : TuxDroid + * size : 8 + */ code struct usb_st_config usb_config = { sizeof(usb_config), STRING, USB_CONFIG_NAME }; +/** \brief Microphone interface. + * Contain microphone interface string + * string : TuxDroid - Micro + */ code struct usb_st_micro_descriptor usb_audio_micro = { sizeof(usb_audio_micro), STRING, AUDIO_MICRO_NAME }; +/** \brief Speaker interface. + * Contain speaker interface string + * string : TuxDroid - Speaker + */ code struct usb_st_speaker_descriptor usb_audio_speaker = { sizeof(usb_audio_speaker), STRING, AUDIO_SPEAKER_NAME }; +/** \brief TTS interface. + * Contain tts interface string + * string : TuxDroid - TTS + */ code struct usb_st_tts_descriptor usb_audio_tts = { sizeof(usb_audio_tts), STRING, AUDIO_TTS_NAME }; +/** \brief Audio interface 1. + * Contain the first audio interface name (micro and speaker) + * string : TuxDroid - Audio + */ code struct usb_st_audio_descriptor usb_audio_normal = { sizeof(usb_audio_normal), STRING, AUDIO_NORMAL_NAME }; +/** \brief General structure. + * This structure contain all the descriptors. + */ code struct usb_configuration_s usb_configuration = { { 9, CONFIGURATION, CONF_LENGTH, NB_INTERFACE, CONF_NB, @@ -584,3 +636,5 @@ } #endif }; + +/* @} */ Modified: firmware/fuxusb/trunk/src/usb_desc.h =================================================================== --- firmware/fuxusb/trunk/src/usb_desc.h 2008-05-19 11:02:54 UTC (rev 1175) +++ firmware/fuxusb/trunk/src/usb_desc.h 2008-05-20 09:28:43 UTC (rev 1176) @@ -19,72 +19,88 @@ /* $Id$ */ +/** \file usb_desc.h + \brief Structures and variable for the descriptors + \ingroup usb_desc +*/ + #ifndef _USB_DESC_H_ #define _USB_DESC_H_ #include "config.h" #include "version.h" - -/* USB descriptor type */ +/** \name Descriptors type + * @{ */ +/** \name Standard descriptors + * @{ */ +/** Device descriptor request */ #define DEVICE 0x01 +/** Device descriptor request */ #define CONFIGURATION 0x02 +/** Device descriptor request */ #define STRING 0x03 +/** Device descriptor request */ #define INTERFACE 0x04 +/** Device descriptor request */ #define ENDPOINT 0x05 +/*! @} */ +/** \name HID specific descriptors + * @{ */ +/** HID descriptor request */ +#define HID 0x21 +/** Report descriptor request */ +#define REPORT 0x22 +/*! @} */ +/*! @} */ -/* HID specifics descriptors */ - -/* Standard features*/ -#define DEVICE_REMOTE_WAKEUP_FEATURE 0x01 -#define ENDPOINT_HALT_FEATURE 0x00 - -/* Device status */ +/** \name Device status, states and configs + * @{ */ +/** Supply status */ #define SELF_POWERED 1 - -/* Device state */ +/** Attached state */ #define ATTACHED 0 +/** Powered state */ #define POWERED 1 +/** Default state */ #define DEFAULT 2 +/** Addressed state */ #define ADDRESSED 3 +/** Configured state */ #define CONFIGURED 4 +/** Suspended state */ #define SUSPENDED 5 - +/** Bus powered config */ #define USB_CONFIG_BUSPOWERED 0x80 +/** Self powered config */ #define USB_CONFIG_SELFPOWERED 0x40 +/** Remote wakeup config */ #define USB_CONFIG_REMOTEWAKEUP 0x20 +/*! @} */ -/* Endpoints */ +/** \name Endpoints + * @{ */ +/** \name IN Endpoints + * @{ */ #define OUT_ENDPOINT1 0x01 #define OUT_ENDPOINT2 0x02 #define OUT_ENDPOINT3 0x03 #define OUT_ENDPOINT4 0x04 #define OUT_ENDPOINT5 0x05 -#define OUT_ENDPOINT6 0x06 - +#define OUT_ENDPOINT6 0x06 +/*! @} */ +/** \name OUT Endpoints + * @{ */ #define IN_ENDPOINT1 0x81 #define IN_ENDPOINT2 0x82 #define IN_ENDPOINT3 0x83 #define IN_ENDPOINT4 0x84 #define IN_ENDPOINT5 0x85 #define IN_ENDPOINT6 0x86 +/*! @} */ +/*! @} */ -/* Descriptors structures */ -struct Endpoint_information_st -{ - uint16_t fifo_size ; /* size of the endpoint FIFO */ - uint16_t fifo_left ; -}; -struct USB_request_st -{ - uint8_t bmRequestType; /* Characteristics of the request */ - uint8_t bRequest; /* Specific request */ - uint16_t wValue; /* field that varies according to request */ - uint16_t wIndex; /* field that varies according to request */ - uint16_t wLength; /* Number of bytes to transfer if Data */ -}; - struct usb_st_device_descriptor { uint8_t bLength; /* Size of this descriptor in bytes */ @@ -105,27 +121,16 @@ struct usb_st_configuration_descriptor { - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* CONFIGURATION descriptor type */ - uint16_t wTotalLength; /* total length of data returned */ - uint8_t bNumInterfaces; /* number of interfaces for this conf. */ - uint8_t bConfigurationValue; /* value for SetConfiguration resquest */ - uint8_t iConfiguration; /* index of string descriptor */ - uint8_t bmAttibutes; /* Configuration characteristics */ - uint8_t MaxPower; /* maximum power consumption */ + uint8_t bLength; /** size of this descriptor in bytes */ + uint8_t bDescriptorType; /** CONFIGURATION descriptor type */ + uint16_t wTotalLength; /** total length of data returned */ + uint8_t bNumInterfaces; /** number of interfaces for this conf. */ + uint8_t bConfigurationValue; /** value for SetConfiguration resquest */ + uint8_t iConfiguration; /** index of string descriptor */ + uint8_t bmAttibutes; /** Configuration characteristics */ + uint8_t MaxPower; /** maximum power consumption */ }; -struct usb_hid_descriptor -{ - uint8_t bLength; /* size of this descriptor in bytes */ - uint8_t bDescriptorType; /* INTERFACE descriptor type */ - uint16_t bcdHID; /* HID spec. */ - uint8_t bCountryCode; /* Country code value*/ - uint8_t bNumDescriptors; /* Number of reports descriptor */ - uint8_t bDescriptorTypeRep; /* Type of the class-specific descriptor */ - uint16_t wDescriptorLength; /* Size of the report descriptor */ -}; - struct usb_st_interface_descriptor { uint8_t bLength; /* size of this descriptor in bytes */ @@ -213,17 +218,16 @@ uint16_t wstring[AUDIO_NORMAL_LENGTH]; /* language id */ }; - /* HID specific */ -struct usb_st_hid_descriptor -{ - uint8_t bLength; /* Size of this descriptor in bytes */ - uint8_t bDescriptorType; /* HID descriptor type */ - uint16_t bscHID; /* Binay Coded Decimal Spec. release */ - uint8_t bCountryCode; /* Hardware target country */ - uint8_t bNumDescriptors; /* Number of HID class descriptors to follow */ - uint8_t bRDescriptorType; /* Report descriptor type */ - uint16_t wDescriptorLength; /* Total length of Report descriptor */ +struct usb_hid_descriptor +{ + uint8_t bLength; /* size of this descriptor in bytes */ + uint8_t bDescriptorType; /* INTERFACE descriptor type */ + uint16_t bcdHID; /* HID spec. */ + uint8_t bCountryCode; /* Country code value*/ + uint8_t bNumDescriptors; /* Number of reports descriptor */ + uint8_t bDescriptorTypeRep; /* Type of the class-specific descriptor */ + uint16_t wDescriptorLength; /* Size of the report descriptor */ }; /* Audio Class specific */ @@ -262,7 +266,7 @@ uint8_t baInterfaceNr[1]; /* Class code assigned by the USB */ }; -/*_____ U S B I N P U T T E R M I N A L D E S C R I P T O R ___________________________*/ +/* Audio input terminal */ struct usb_Audio_InputTerminal_descriptor { uint8_t bLength; /* size of this descriptor in bytes */ @@ -277,7 +281,7 @@ uint8_t iTerminal; /*Index of a string descriptor, describing the Input Terminal. */ }; -/*_____ U S B O U T P U T T E R M I N A L D E S C R I P T O R ___________________________*/ +/* Audio output terminal */ struct usb_Audio_OutputTerminal_descriptor { uint8_t bLength; /* size of this descriptor in bytes */ @@ -290,7 +294,7 @@ uint8_t iTerminal; /*Index of a string descriptor, describing the Input Terminal. */ }; -/*_____ U S B F E A T U R E U N I T D E S C R I P T O R ___________________________*/ +/* Audio feature unit */ struct usb_Audio_FeatureUnit_descriptor { uint8_t bLength; /* size of this descriptor in bytes */ @@ -303,7 +307,7 @@ uint8_t iFeature; /*Index of a string descriptor, describing this Feature Unit.. */ }; -/*_____ U S B S T D AUDIO STREAM I N T E R F A C E D E S C R I P T O R _____________________*/ +/* Audio stream */ struct usb_Audio_st_ASinterface_descriptor { uint8_t bLength; /* size of this descriptor in bytes */ @@ -317,7 +321,7 @@ uint8_t iInterface; /* Index of string descriptor */ }; -/*_____ U S B C S AUDIO STREAM I N T E R F A C E D E S C R I P T O R _____________________*/ +/* Audio class specific */ struct usb_Audio_cs_ASinterface_descriptor { uint8_t bLength; /* size of this descriptor in bytes */ @@ -328,7 +332,7 @@ uint16_t wFormatTag; /* Class code assigned by the USB */ }; -/*_____ U S B AUDIO ST E N D P O I N T D E S C R I P T O R _______________________*/ +/* Audio EP */ struct usb_Audio_st_endpoint_descriptor { uint8_t bLength; /* Size of this descriptor in bytes */ @@ -341,7 +345,7 @@ uint8_t bSynchAddress; /* The address of the endpoint used to communicate synchronization information if required by this endpoint..*/ }; -/*_____ U S B AUDIO S T E N D P O I N T D E S C R I P T O R _______________________*/ +/* Audio stream */ struct usb_Audio_cs_ASendpoint_descriptor { uint8_t bLength; /* Size of this descriptor in bytes */ @@ -352,7 +356,7 @@ uint16_t wLockDelay; /* Reset to 0.*/ }; -/*_____ U S B AUDIO S T E N D P O I N T D E S C R I P T O R _______________________*/ +/* Audio endpoint */ struct usb_Audio_TYPEI_FormatType_descriptor { uint8_t bLength; /* Size of this descriptor in bytes */ @@ -366,20 +370,29 @@ uint8_t bSamFreqTbl[3]; /*See sampling frequency tables*/ }; +/** \name General structure + * This structure contain all the descriptors. + * @{ */ struct usb_configuration_s -{ +{ + /** Configuration descriptor */ struct usb_st_configuration_descriptor cfg; - //------------------------------------------------------------------------- - // Audio - //------------------------------------------------------------------------- - // Interface 0 :: Audio Control - //------------------------------------------------------------------------- - struct usb_Audio_st_ACinterface_descriptor StandardACInterfaceDescriptor_1; + + /** \name Interface 0 : Audio control + * @{ */ + /** Standard interface descriptor */ + struct usb_Audio_st_ACinterface_descriptor StandardACInterfaceDescriptor_1; + /** Specific interface descriptor */ struct usb_Audio_cs_ACinterface_descriptor SpecificACInterfaceDescriptor; + /** Microphone input terminal */ struct usb_Audio_InputTerminal_descriptor MicInputTerminal1Descriptor; + /** Speaker input terminal */ struct usb_Audio_InputTerminal_descriptor SpkInputTerminalDescriptor; + /** Microphone output terminal */ struct usb_Audio_OutputTerminal_descriptor MicOutputTerminal1Descriptor; + /** Speaker output descriptor */ struct usb_Audio_OutputTerminal_descriptor SpkOutputTerminalDescriptor; + /* @} */ // Interface 1 :: Audio Stream Microphone //------------------------------------------------------------------------- @@ -437,6 +450,7 @@ uint8_t rep[SIZE_OF_REPORT]; #endif }; +/* @} */ extern code struct usb_st_device_descriptor usb_device_descriptor; Modified: firmware/fuxusb/trunk/src/usb_enum.c =================================================================== --- firmware/fuxusb/trunk/src/usb_enum.c 2008-05-19 11:02:54 UTC (rev 1175) +++ firmware/fuxusb/trunk/src/usb_enum.c 2008-05-20 09:28:43 UTC (rev 1176) @@ -19,7 +19,7 @@ /* $Id$ */ -/** \file usb_enum.c +/*! \file usb_enum.c \brief Function to control the enumeration process * \ingroup usb_enum */ Modified: firmware/fuxusb/trunk/src/usb_enum.h =================================================================== --- firmware/fuxusb/trunk/src/usb_enum.h 2008-05-19 11:02:54 UTC (rev 1175) +++ firmware/fuxusb/trunk/src/usb_enum.h 2008-05-20 09:28:43 UTC (rev 1176) @@ -21,7 +21,7 @@ /** \file usb_enum.h - \brief Specifics define forthe enumeration process and public defs. + \brief Specifics define for the enumeration process and public defs. \ingroup usb_enum */ @@ -121,9 +121,9 @@ #define AUDIO 0x20 /*! @} */ -void usb_var_init(void); -void usb_ep_init(void); -void usb_enumeration_process(void); +void usb_var_init(void); +void usb_ep_init(void); +void usb_enumeration_process(void); extern uint8_t usb_configuration_nb; Modified: firmware/fuxusb/trunk/src/usb_ep.c =================================================================== --- firmware/fuxusb/trunk/src/usb_ep.c 2008-05-19 11:02:54 UTC (rev 1175) +++ firmware/fuxusb/trunk/src/usb_ep.c 2008-05-20 09:28:43 UTC (rev 1176) @@ -19,6 +19,11 @@ /* $Id$ */ +/** \file usb_ep.c + \brief USB Endpoints functions + \ingroup usb_ep +*/ + #include "config.h" #include "usb_ep.h" #include "usb_enum.h" @@ -45,6 +50,7 @@ /** * \brief Parse all endpoints + * \ingroup usb_ep */ void endpoints_parser(void) { @@ -88,7 +94,8 @@ } /** - * \brief Send the statuses previously prepared + * \brief Send the statuses previously prepared. + * \ingroup usb_ep */ void send_status(void) { @@ -107,6 +114,7 @@ * When the EP fifo isn't loaded, 8 bytes are transfered from the MIC fifo to * the EP fifo. * The microphone EP is isochronous with a polling interval of 1ms. + * \ingroup usb_ep */ void fill_mic_ep(void) { @@ -177,6 +185,7 @@ /** * \brief Clear the RX flag of the cmd out EP. + * This function clear the RX flag and control the banks number. */ static void clear_cmdout_ep(void) { @@ -229,6 +238,11 @@ #endif } +/** + * \brief Clear CMD IN endpoint. + * This function clear the TX flag, manage banks number and control if all data + * has been sent. + */ static void clear_cmdin_ep(void) { Usb_select_ep(EP_CMD_IN); Modified: firmware/fuxusb/trunk/src/usb_ep.h =================================================================== --- firmware/fuxusb/trunk/src/usb_ep.h 2008-05-19 11:02:54 UTC (rev 1175) +++ firmware/fuxusb/trunk/src/usb_ep.h 2008-05-20 09:28:43 UTC (rev 1176) @@ -19,6 +19,11 @@ /* $Id$ */ +/** \file usb_ep.h + \brief USB Endpoints functions + \ingroup usb_ep +*/ + #ifndef _USB_EP_H_ #define _USB_EP_H_ Modified: firmware/fuxusb/trunk/src/usb_misc.c =================================================================== --- firmware/fuxusb/trunk/src/usb_misc.c 2008-05-19 11:02:54 UTC (rev 1175) +++ firmware/fuxusb/trunk/src/usb_misc.c 2008-05-20 09:28:43 UTC (rev 1176) @@ -19,6 +19,11 @@ /* $Id$ */ +/** \file usb_misc.c + \brief Misc USB functions. + \ingroup usb_misc +*/ + #include "config.h" #include "global.h" #include "usb_misc.h" @@ -30,6 +35,7 @@ /** * \brief Suspend the USB bus. * This function suspend the bus and keep the rf board on reset state. + * \ingroup usb_misc */ void suspend_usb(void) { @@ -41,6 +47,7 @@ /** * \brief Resume the USB bus. * This function resume the bus afetr a suspend state. + * \ingroup usb_misc */ void resume_usb(void) { @@ -53,6 +60,7 @@ /** * \brief Reset the bus. * This function reset the usb bus. + * \ingroup usb_misc */ void reset_usb(void) { @@ -65,6 +73,7 @@ * \brief reattach USB. * This function simulate a disconnexion/connexion of the USB device. * This is used when the device has to be re-enumerated (ISP mode for example). + * \ingroup usb_misc */ void reattach_usb(void) { Modified: firmware/fuxusb/trunk/src/usb_misc.h =================================================================== --- firmware/fuxusb/trunk/src/usb_misc.h 2008-05-19 11:02:54 UTC (rev 1175) +++ firmware/fuxusb/trunk/src/usb_misc.h 2008-05-20 09:28:43 UTC (rev 1176) @@ -19,6 +19,11 @@ /* $Id$ */ +/** \file usb_misc.h + \brief Misc USB functions. + \ingroup usb_misc +*/ + #ifndef _USB_MISC_H_ #define _USB_MISC_H_ @@ -26,7 +31,6 @@ void resume_usb(void); void reset_usb(void); void reattach_usb(void); -void usb_var_init (void); #endif // _USB_MISC_H_ |
From: jerome <c2m...@c2...> - 2008-05-19 11:02:52
|
Author: jerome Date: 2008-05-19 13:02:54 +0200 (Mon, 19 May 2008) New Revision: 1175 Removed: software/gadgets/skype_controller/skype_controller/ Modified: software/gadgets/skype_controller/skype_controller.tgf Log: * Added a tts function. Modified: software/gadgets/skype_controller/skype_controller.tgf =================================================================== (Binary files differ) |
From: remi <c2m...@c2...> - 2008-05-19 10:05:42
|
Author: remi Date: 2008-05-19 12:05:33 +0200 (Mon, 19 May 2008) New Revision: 1174 Removed: software_suite_v2/middleware/TuxHTTPRESTServer/trunk/test_http_client.py Log: Oups this file was commited by error. Deleted: software_suite_v2/middleware/TuxHTTPRESTServer/trunk/test_http_client.py =================================================================== --- software_suite_v2/middleware/TuxHTTPRESTServer/trunk/test_http_client.py 2008-05-19 10:01:42 UTC (rev 1173) +++ software_suite_v2/middleware/TuxHTTPRESTServer/trunk/test_http_client.py 2008-05-19 10:05:33 UTC (rev 1174) @@ -1,23 +0,0 @@ -import httplib -import time - -h = httplib.HTTP("localhost") -h.connect() - -while True: - h.putrequest("HEADER","/test/xml?truc=45") - - h.putheader("Accept", "text/html") - h.putheader("Accept", "text/xml") - h.putheader("Accept-Charset", "iso-8859-1,*,utf-8") - h.endheaders() - - - errcode, errmsg, headers = h.getreply() - #f = h.getfile() - #s = f.read() - #f.close() - #print s - #print "content length: %d" % len(s) - print headers - time.sleep(0.01) \ No newline at end of file |
From: remi <c2m...@c2...> - 2008-05-19 10:01:55
|
Author: remi Date: 2008-05-19 12:01:42 +0200 (Mon, 19 May 2008) New Revision: 1173 Added: software_suite_v2/middleware/TuxHTTPRESTServer/ software_suite_v2/middleware/TuxHTTPRESTServer/branches/ software_suite_v2/middleware/TuxHTTPRESTServer/tags/ software_suite_v2/middleware/TuxHTTPRESTServer/trunk/ software_suite_v2/middleware/TuxHTTPRESTServer/trunk/AUTHORS software_suite_v2/middleware/TuxHTTPRESTServer/trunk/AcaTTS.ini software_suite_v2/middleware/TuxHTTPRESTServer/trunk/AcaTts.dll software_suite_v2/middleware/TuxHTTPRESTServer/trunk/BabTts.conf software_suite_v2/middleware/TuxHTTPRESTServer/trunk/COPYING software_suite_v2/middleware/TuxHTTPRESTServer/trunk/README software_suite_v2/middleware/TuxHTTPRESTServer/trunk/TuxDroidHTTPRESTServer.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/data/ software_suite_v2/middleware/TuxHTTPRESTServer/trunk/data/html/ software_suite_v2/middleware/TuxHTTPRESTServer/trunk/data/html/test_mouth_cmd.html software_suite_v2/middleware/TuxHTTPRESTServer/trunk/data/js/ software_suite_v2/middleware/TuxHTTPRESTServer/trunk/data/js/CommandRequest.js software_suite_v2/middleware/TuxHTTPRESTServer/trunk/data/js/Hashtable.js software_suite_v2/middleware/TuxHTTPRESTServer/trunk/data/js/TuxAPI.js software_suite_v2/middleware/TuxHTTPRESTServer/trunk/data/xsl/ software_suite_v2/middleware/TuxHTTPRESTServer/trunk/data/xsl/services.xsl software_suite_v2/middleware/TuxHTTPRESTServer/trunk/libacatts.so software_suite_v2/middleware/TuxHTTPRESTServer/trunk/libtuxdriver.dll software_suite_v2/middleware/TuxHTTPRESTServer/trunk/libtuxdriver.so software_suite_v2/middleware/TuxHTTPRESTServer/trunk/libtuxosl.dll software_suite_v2/middleware/TuxHTTPRESTServer/trunk/libtuxosl.so software_suite_v2/middleware/TuxHTTPRESTServer/trunk/resources/ software_suite_v2/middleware/TuxHTTPRESTServer/trunk/resources/td_resource_access.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/resources/td_resource_attitune.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/resources/td_resource_client.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/resources/td_resource_eyes.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/resources/td_resource_files.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/resources/td_resource_ir.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/resources/td_resource_leds.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/resources/td_resource_mouth.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/resources/td_resource_parent.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/resources/td_resource_sound_flash.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/resources/td_resource_spinning.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/resources/td_resource_status.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/resources/td_resource_tts.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/resources/td_resource_wav.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/resources/td_resource_wings.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/server.bat software_suite_v2/middleware/TuxHTTPRESTServer/trunk/td_access_controller.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/td_attitunes.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/td_attitunes_conv.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/td_client_controller.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/td_error.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/td_file_abstraction.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/td_http_server.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/td_services.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/td_xml.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/test_http_client.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/tmp/ software_suite_v2/middleware/TuxHTTPRESTServer/trunk/tux_driver.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/tux_osl.py software_suite_v2/middleware/TuxHTTPRESTServer/trunk/version.py Log: First commit of Tuxdroid HTTP REST Server. Work on linux and windows. Added: software_suite_v2/middleware/TuxHTTPRESTServer/trunk/AUTHORS =================================================================== --- software_suite_v2/middleware/TuxHTTPRESTServer/trunk/AUTHORS (rev 0) +++ software_suite_v2/middleware/TuxHTTPRESTServer/trunk/AUTHORS 2008-05-19 10:01:42 UTC (rev 1173) @@ -0,0 +1,5 @@ +TuxDroidHTTPRESTServer was written by: + + Remi Jocaille <rem...@c2...> + +Contributors: Property changes on: software_suite_v2/middleware/TuxHTTPRESTServer/trunk/AUTHORS ___________________________________________________________________ Name: svn:executable + * Added: software_suite_v2/middleware/TuxHTTPRESTServer/trunk/AcaTTS.ini =================================================================== --- software_suite_v2/middleware/TuxHTTPRESTServer/trunk/AcaTTS.ini (rev 0) +++ software_suite_v2/middleware/TuxHTTPRESTServer/trunk/AcaTTS.ini 2008-05-19 10:01:42 UTC (rev 1173) @@ -0,0 +1,14 @@ +[kernel] +rootkey=[HKLM\Software\Acapela Group\Acapela TTS Multimedia 6\] +[SAPI4] +engine=Acapela Multimedia +product=Acapela Multimedia SDK V6 +GUID=76AB1FC6-3BAD-424b-B3FE-4D8719679016 +Prefix= +VoiceName=<speaker>, <type> <frequency>k, <language>, SAPI4, Acapela Multimedia +[SAPI5] +engine=Acapela Multimedia +product=Acapela Multimedia SDK V6 +EnumGUID=C8BA1706-5029-400a-A67F-BD28A213791B +EngineGUID=42F8843F-2838-41b5-AF4C-3F1F83E27DBE +VoiceName=<speaker>, <type> <frequency>k, <language>, SAPI5, Acapela Multimedia \ No newline at end of file Property changes on: software_suite_v2/middleware/TuxHTTPRESTServer/trunk/AcaTTS.ini ___________________________________________________________________ Name: svn:executable + * Added: software_suite_v2/middleware/TuxHTTPRESTServer/trunk/AcaTts.dll =================================================================== (Binary files differ) Property changes on: software_suite_v2/middleware/TuxHTTPRESTServer/trunk/AcaTts.dll ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: software_suite_v2/middleware/TuxHTTPRESTServer/trunk/BabTts.conf =================================================================== --- software_suite_v2/middleware/TuxHTTPRESTServer/trunk/BabTts.conf (rev 0) +++ software_suite_v2/middleware/TuxHTTPRESTServer/trunk/BabTts.conf 2008-05-19 10:01:42 UTC (rev 1173) @@ -0,0 +1,397 @@ +<?xml version="1.0"?> +<root> + <Languages> + <USEnglish + Version="6_0_26035_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/USEnglish_6_0_26035_1.crc" + XMLDefault="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/enu.tml" + PHOTREE="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/enu.trr" + PROSO="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/enu.oso" + F0="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/enu.f0r" + DICTIONARY="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/enu.bab.dca" + BNF="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/enu.bnx" + BNFNOTAG="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/enu.notag.bnx" + SPD="180" + LDI="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/enu.bab.ldi" + GRI="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/enu.gri" + GRO="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/enu.gro" + Language="USEnglish" + Info="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/enu.nfo" + POST="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/enu.pst"/> + <French + Version="6_0_26035_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/French_6_0_26035_1.crc" + XMLDefault="/opt/Acapela/TelecomTTS/babtts/engines/French/frf.tml" + PHOTREE="/opt/Acapela/TelecomTTS/babtts/engines/French/frf.trx" + PROSO="/opt/Acapela/TelecomTTS/babtts/engines/French/frf.oso" + F0="/opt/Acapela/TelecomTTS/babtts/engines/French/frf.f0r" + DICTIONARY="/opt/Acapela/TelecomTTS/babtts/engines/French/frf.bab.dca" + DICTIONARY2="/opt/Acapela/TelecomTTS/babtts/engines/French/frb.bab.dca" + DICTIONARYNUM="1" + BNF="/opt/Acapela/TelecomTTS/babtts/engines/French/frf.bnx" + BNFNOTAG="/opt/Acapela/TelecomTTS/babtts/engines/French/frf.notag.bnx" + SPD="180" + LDI="/opt/Acapela/TelecomTTS/babtts/engines/French/frf.bab.ldi" + GRI="/opt/Acapela/TelecomTTS/babtts/engines/French/frf.gri" + GRO="/opt/Acapela/TelecomTTS/babtts/engines/French/frf.gro" + POST="/opt/Acapela/TelecomTTS/babtts/engines/French/frf.pst" + Language="French" + Info="/opt/Acapela/TelecomTTS/babtts/engines/French/frf.nfo" + SPECIALSYSDICT="/opt/Acapela/TelecomTTS/babtts/engines/French/frf_accent_restoration.bab.dca" + USESPECIALSYSDICT="1"/> + <BelgianDutch + Version="6_0_27110_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/BelgianDutch_6_0_27110_1.crc" + XMLDefault="/opt/Acapela/TelecomTTS/babtts/engines/BelgianDutch/dub.tml" + PHOTREE="/opt/Acapela/TelecomTTS/babtts/engines/BelgianDutch/dub.trr" + PROSO="/opt/Acapela/TelecomTTS/babtts/engines/BelgianDutch/dub.oso" + F0="/opt/Acapela/TelecomTTS/babtts/engines/BelgianDutch/dub.f0r" + DICTIONARY="/opt/Acapela/TelecomTTS/babtts/engines/BelgianDutch/dub.bab.dca" + LDI="/opt/Acapela/TelecomTTS/babtts/engines/BelgianDutch/dub.bab.ldi" + BNF="/opt/Acapela/TelecomTTS/babtts/engines/BelgianDutch/dub.bnx" + BNFNOTAG="/opt/Acapela/TelecomTTS/babtts/engines/BelgianDutch/dub.notag.bnx" + POST="/opt/Acapela/TelecomTTS/babtts/engines/BelgianDutch/dub.pst" + SPD="180" + Language="BelgianDutch" + Info="/opt/Acapela/TelecomTTS/babtts/engines/BelgianDutch/dub.nfo" + DUMPEXCEPT="1"/> + <Italian + Version="6_0_27114_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Italian_6_0_27114_1.crc" + XMLDefault="/opt/Acapela/TelecomTTS/babtts/engines/Italian/iti.tml" + PHOTREE="/opt/Acapela/TelecomTTS/babtts/engines/Italian/iti.trx" + PROSO="/opt/Acapela/TelecomTTS/babtts/engines/Italian/iti.oso" + F0="/opt/Acapela/TelecomTTS/babtts/engines/Italian/iti.f0r" + DICTIONARY="/opt/Acapela/TelecomTTS/babtts/engines/Italian/iti.bab.dca" + LDI="/opt/Acapela/TelecomTTS/babtts/engines/Italian/iti.bab.ldi" + BNF="/opt/Acapela/TelecomTTS/babtts/engines/Italian/iti.bnx" + BNFNOTAG="/opt/Acapela/TelecomTTS/babtts/engines/Italian/iti.notag.bnx" + POST="/opt/Acapela/TelecomTTS/babtts/engines/Italian/iti.pst" + SPD="180" + Language="Italian" + Info="/opt/Acapela/TelecomTTS/babtts/engines/Italian/iti.nfo" + DUMPEXCEPT="1"/> + <German + Version="6_0_27114_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/German_6_0_27114_1.crc" + XMLDefault="/opt/Acapela/TelecomTTS/babtts/engines/German/ged.tml" + PHOTREE="/opt/Acapela/TelecomTTS/babtts/engines/German/ged.trx" + PROSO="/opt/Acapela/TelecomTTS/babtts/engines/German/ged.oso" + F0="/opt/Acapela/TelecomTTS/babtts/engines/German/ged.f0r" + DICTIONARY="/opt/Acapela/TelecomTTS/babtts/engines/German/ged.bab.dca" + LDI="/opt/Acapela/TelecomTTS/babtts/engines/German/ged.bab.ldi" + BNF="/opt/Acapela/TelecomTTS/babtts/engines/German/ged.bnx" + BNFNOTAG="/opt/Acapela/TelecomTTS/babtts/engines/German/ged.notag.bnx" + POST="/opt/Acapela/TelecomTTS/babtts/engines/German/ged.pst" + GRI="/opt/Acapela/TelecomTTS/babtts/engines/German/ged.gri" + GRO="/opt/Acapela/TelecomTTS/babtts/engines/German/ged.gro" + SPD="180" + Language="German" + Info="/opt/Acapela/TelecomTTS/babtts/engines/German/ged.nfo" + DUMPEXCEPT="1"/> + <British + Version="6_0_27114_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/British_6_0_27114_1.crc" + XMLDefault="/opt/Acapela/TelecomTTS/babtts/engines/British/eng.tml" + PHOTREE="/opt/Acapela/TelecomTTS/babtts/engines/British/eng.trx" + PROSO="/opt/Acapela/TelecomTTS/babtts/engines/British/eng.oso" + F0="/opt/Acapela/TelecomTTS/babtts/engines/British/eng.f0r" + DICTIONARY="/opt/Acapela/TelecomTTS/babtts/engines/British/eng.bab.dca" + LDI="/opt/Acapela/TelecomTTS/babtts/engines/British/eng.bab.ldi" + BNF="/opt/Acapela/TelecomTTS/babtts/engines/British/eng.bnx" + BNFNOTAG="/opt/Acapela/TelecomTTS/babtts/engines/British/eng.notag.bnx" + POST="/opt/Acapela/TelecomTTS/babtts/engines/British/eng.pst" + GRI="/opt/Acapela/TelecomTTS/babtts/engines/British/eng.gri" + GRO="/opt/Acapela/TelecomTTS/babtts/engines/British/eng.gro" + SPD="180" + Language="British" + Info="/opt/Acapela/TelecomTTS/babtts/engines/British/eng.nfo" + DUMPEXCEPT="1"/> + <Arabic + Version="6_0_27114_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Arabic_6_0_27114_1.crc" + XMLDefault="/opt/Acapela/TelecomTTS/babtts/engines/Arabic/arm.tml" + PHOTREE="/opt/Acapela/TelecomTTS/babtts/engines/Arabic/arm.trr" + PROSO="/opt/Acapela/TelecomTTS/babtts/engines/Arabic/arm.oso" + F0="/opt/Acapela/TelecomTTS/babtts/engines/Arabic/arm.f0r" + DICTIONARY="/opt/Acapela/TelecomTTS/babtts/engines/Arabic/arm.bab.dca" + LDI="/opt/Acapela/TelecomTTS/babtts/engines/Arabic/arm.bab.ldi" + BNF="/opt/Acapela/TelecomTTS/babtts/engines/Arabic/arm.bnx" + BNFNOTAG="/opt/Acapela/TelecomTTS/babtts/engines/Arabic/arm.notag.bnx" + POST="/opt/Acapela/TelecomTTS/babtts/engines/Arabic/arm.pst" + SPD="180" + Language="Arabic" + Info="/opt/Acapela/TelecomTTS/babtts/engines/Arabic/arm.nfo" + DUMPEXCEPT="1" + RDIMSP="/opt/Acapela/TelecomTTS/babtts/engines/Arabic/Morpho4SLM.MSP" + RDIAPM="/opt/Acapela/TelecomTTS/babtts/engines/Arabic/Morpho4SLM.APM" + RDIPSD="/opt/Acapela/TelecomTTS/babtts/engines/Arabic/Morpho4SLM.PSD" + RDIAFTERPREPRO="1"/> + <Danish + Version="6_0_27114_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Danish_6_0_27114_1.crc" + XMLDefault="/opt/Acapela/TelecomTTS/babtts/engines/Danish/dad.tml" + PHOTREE="/opt/Acapela/TelecomTTS/babtts/engines/Danish/dad.trx" + PROSO="/opt/Acapela/TelecomTTS/babtts/engines/Danish/dad.oso" + F0="/opt/Acapela/TelecomTTS/babtts/engines/Danish/dad.f0r" + DICTIONARY="/opt/Acapela/TelecomTTS/babtts/engines/Danish/dad.bab.dca" + LDI="/opt/Acapela/TelecomTTS/babtts/engines/Danish/dad.bab.ldi" + BNF="/opt/Acapela/TelecomTTS/babtts/engines/Danish/dad.bnx" + BNFNOTAG="/opt/Acapela/TelecomTTS/babtts/engines/Danish/dad.notag.bnx" + POST="/opt/Acapela/TelecomTTS/babtts/engines/Danish/dad.pst" + GRI="/opt/Acapela/TelecomTTS/babtts/engines/Danish/dad.gri" + GRO="/opt/Acapela/TelecomTTS/babtts/engines/Danish/dad.gro" + STI="/opt/Acapela/TelecomTTS/babtts/engines/Danish/dad.sti" + STW="/opt/Acapela/TelecomTTS/babtts/engines/Danish/dad.stw" + SPD="180" + Language="Arabic" + Info="/opt/Acapela/TelecomTTS/babtts/engines/Danish/dad.nfo" + DUMPEXCEPT="1"/> + <Dutch + Version="6_0_27114_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Dutch_6_0_27114_1.crc" + XMLDefault="/opt/Acapela/TelecomTTS/babtts/engines/Dutch/dun.tml" + PHOTREE="/opt/Acapela/TelecomTTS/babtts/engines/Dutch/dun.trr" + PROSO="/opt/Acapela/TelecomTTS/babtts/engines/Dutch/dun.oso" + F0="/opt/Acapela/TelecomTTS/babtts/engines/Dutch/dun.f0r" + DICTIONARY="/opt/Acapela/TelecomTTS/babtts/engines/Dutch/dun.bab.dca" + LDI="/opt/Acapela/TelecomTTS/babtts/engines/Dutch/dun.bab.ldi" + BNF="/opt/Acapela/TelecomTTS/babtts/engines/Dutch/dun.bnx" + BNFNOTAG="/opt/Acapela/TelecomTTS/babtts/engines/Dutch/dun.notag.bnx" + POST="/opt/Acapela/TelecomTTS/babtts/engines/Dutch/dun.pst" + GRI="/opt/Acapela/TelecomTTS/babtts/engines/Dutch/dun.gri" + GRO="/opt/Acapela/TelecomTTS/babtts/engines/Dutch/dun.gro" + SPD="180" + Language="Dutch" + Info="/opt/Acapela/TelecomTTS/babtts/engines/Dutch/dun.nfo" + DUMPEXCEPT="1"/> + <Norwegian + Version="6_0_27110_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Norwegian_6_0_27110_1.crc" + XMLDefault="/opt/Acapela/TelecomTTS/babtts/engines/Norwegian/non.tml" + PHOTREE="/opt/Acapela/TelecomTTS/babtts/engines/Norwegian/non.trx" + PROSO="/opt/Acapela/TelecomTTS/babtts/engines/Norwegian/non.oso" + F0="/opt/Acapela/TelecomTTS/babtts/engines/Norwegian/non.f0r" + DICTIONARY="/opt/Acapela/TelecomTTS/babtts/engines/Norwegian/non.bab.dca" + LDI="/opt/Acapela/TelecomTTS/babtts/engines/Norwegian/non.bab.ldi" + BNF="/opt/Acapela/TelecomTTS/babtts/engines/Norwegian/non.bnx" + BNFNOTAG="/opt/Acapela/TelecomTTS/babtts/engines/Norwegian/non.notag.bnx" + POST="/opt/Acapela/TelecomTTS/babtts/engines/Norwegian/non.pst" + SPD="180" + Language="Norwegian" + Info="/opt/Acapela/TelecomTTS/babtts/engines/Norwegian/non.nfo" + DUMPEXCEPT="1"/> + <Spanish + Version="6_0_27110_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Spanish_6_0_27110_1.crc" + XMLDefault="/opt/Acapela/TelecomTTS/babtts/engines/Spanish/sps.tml" + PHOTREE="/opt/Acapela/TelecomTTS/babtts/engines/Spanish/sps.trx" + PROSO="/opt/Acapela/TelecomTTS/babtts/engines/Spanish/sps.oso" + F0="/opt/Acapela/TelecomTTS/babtts/engines/Spanish/sps.f0r" + DICTIONARY="/opt/Acapela/TelecomTTS/babtts/engines/Spanish/sps.bab.dca" + LDI="/opt/Acapela/TelecomTTS/babtts/engines/Spanish/sps.bab.ldi" + BNF="/opt/Acapela/TelecomTTS/babtts/engines/Spanish/sps.bnx" + BNFNOTAG="/opt/Acapela/TelecomTTS/babtts/engines/Spanish/sps.notag.bnx" + POST="/opt/Acapela/TelecomTTS/babtts/engines/Spanish/sps.pst" + SPD="180" + Language="Spanish" + Info="/opt/Acapela/TelecomTTS/babtts/engines/Spanish/sps.nfo" + DUMPEXCEPT="1"/> + <Swedish + Version="6_0_27114_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Swedish_6_0_27114_1.crc" + XMLDefault="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/sws.tml" + PHOTREE="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/sws.trx" + PROSO="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/sws.oso" + F0="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/sws.f0r" + DICTIONARY="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/sws.bab.dca" + LDI="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/sws.bab.ldi" + BNF="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/sws.bnx" + BNFNOTAG="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/sws.notag.bnx" + POST="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/sws.pst" + GRI="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/sws.gri" + GRO="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/sws.gro" + STI="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/sws.sti" + SPD="180" + Language="Swedish" + Info="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/sws.nfo"/> + <Portuguese + Version="6_0_27110_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Portuguese_6_0_27110_1.crc" + XMLDefault="/opt/Acapela/TelecomTTS/babtts/engines/Portuguese/poe.tml" + PHOTREE="/opt/Acapela/TelecomTTS/babtts/engines/Portuguese/poe.trx" + PROSO="/opt/Acapela/TelecomTTS/babtts/engines/Portuguese/poe.oso" + F0="/opt/Acapela/TelecomTTS/babtts/engines/Portuguese/poe.f0r" + DICTIONARY="/opt/Acapela/TelecomTTS/babtts/engines/Portuguese/poe.bab.dca" + LDI="/opt/Acapela/TelecomTTS/babtts/engines/Portuguese/poe.bab.ldi" + BNF="/opt/Acapela/TelecomTTS/babtts/engines/Portuguese/poe.bnx" + BNFNOTAG="/opt/Acapela/TelecomTTS/babtts/engines/Portuguese/poe.notag.bnx" + POST="/opt/Acapela/TelecomTTS/babtts/engines/Portuguese/poe.pst" + SPD="180" + Language="Portuguese" + Info="/opt/Acapela/TelecomTTS/babtts/engines/Portuguese/poe.nfo" + DUMPEXCEPT="1"/> + </Languages> + <Speechfonts> + <Ryan8k + Version="6_0_26035_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Ryan8k_6_0_26035_1.crc" + Base="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/Ryan8k/Ryan8k.nuul" + Coeff="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/Ryan8k/Ryan8k.coef" + Database="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/Ryan8k/Ryan8k.vco" + Info="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/Ryan8k/Ryan8k.nfo" + Pitch="100" Speed="100" Freq="8000"/> + <Bruno8k + Version="6_0_26214_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Bruno22k_6_0_26214_1.crc" + Base="/opt/Acapela/TelecomTTS/babtts/engines/French/Bruno8k/Bruno8k.nuul" + Coeff="/opt/Acapela/TelecomTTS/babtts/engines/French/Bruno8k/Bruno8k.coef" + Database="/opt/Acapela/TelecomTTS/babtts/engines/French/Bruno8k/Bruno8k.vco" + Info="/opt/Acapela/TelecomTTS/babtts/engines/French/Bruno8k/Bruno8k.nfo" + Pitch="100" Speed="100" Freq="8000"/> + <Julie8k + Version="6_0_26214_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Julie22k_6_0_26214_1.crc" + Base="/opt/Acapela/TelecomTTS/babtts/engines/French/Julie8k/Julie8k.nuul" + Coeff="/opt/Acapela/TelecomTTS/babtts/engines/French/Julie8k/Julie8k.coef" + Database="/opt/Acapela/TelecomTTS/babtts/engines/French/Julie8k/Julie8k.vco" + Info="/opt/Acapela/TelecomTTS/babtts/engines/French/Julie8k/Julie8k.nfo" + Pitch="180" Speed="100" Freq="8000"/> + <Heather8k + Version="6_0_26214_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Heather22k1Salutmec.crc" + Base="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/Heather8k/Heather8k.nuul" + Coeff="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/Heather8k/Heather8k.coef" + Database="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/Heather8k/Heather8k.vco" + Info="/opt/Acapela/TelecomTTS/babtts/engines/USEnglish/Heather8k/Heather8k.nfo" + Pitch="180" Speed="100" Freq="8000"/> + <Sofie8k + Version="6_0_26213_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Sofie8k_6_0_26213_1.crc" + Base="/opt/Acapela/TelecomTTS/babtts/engines/BelgianDutch/Sofie8k/Sofie8k.nuul" + Coeff="/opt/Acapela/TelecomTTS/babtts/engines/BelgianDutch/Sofie8k/Sofie8k.coef" + Database="/opt/Acapela/TelecomTTS/babtts/engines/BelgianDutch/Sofie8k/Sofie8k.vco" + Info="/opt/Acapela/TelecomTTS/babtts/engines/BelgianDutch/Sofie8k/Sofie8k.nfo" + Pitch="190" Speed="100" Freq="8000"/> + <Chiara8k + Version="6_0_26213_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Chiara8k_6_0_26213_1.crc" + Base="/opt/Acapela/TelecomTTS/babtts/engines/Italian/Chiara8k/Chiara8k.nuul" + Coeff="/opt/Acapela/TelecomTTS/babtts/engines/Italian/Chiara8k/Chiara8k.coef" + Database="/opt/Acapela/TelecomTTS/babtts/engines/Italian/Chiara8k/Chiara8k.vco" + Info="/opt/Acapela/TelecomTTS/babtts/engines/Italian/Chiara8k/Chiara8k.nfo" + Pitch="200" Speed="100" Freq="8000"/> + <Klaus8k + Version="6_0_26213_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Klaus8k_6_0_26213_1.crc" + Base="/opt/Acapela/TelecomTTS/babtts/engines/German/Klaus8k/Klaus8k.nuul" + Coeff="/opt/Acapela/TelecomTTS/babtts/engines/German/Klaus8k/Klaus8k.coef" + Database="/opt/Acapela/TelecomTTS/babtts/engines/German/Klaus8k/Klaus8k.vco" + Info="/opt/Acapela/TelecomTTS/babtts/engines/German/Klaus8k/Klaus8k.nfo" + Pitch="110" Speed="100" Freq="8000"/> + <Sarah8k + Version="6_0_26213_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Sarah8k_6_0_26213_1.crc" + Base="/opt/Acapela/TelecomTTS/babtts/engines/German/Sarah8k/Sarah8k.nuul" + Coeff="/opt/Acapela/TelecomTTS/babtts/engines/German/Sarah8k/Sarah8k.coef" + Database="/opt/Acapela/TelecomTTS/babtts/engines/German/Sarah8k/Sarah8k.vco" + Info="/opt/Acapela/TelecomTTS/babtts/engines/German/Sarah8k/Sarah8k.nfo" + Pitch="180" Speed="100" Freq="8000"/> + <Graham8k + Version="6_0_26213_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Graham8k_6_0_26213_1.crc" + Base="/opt/Acapela/TelecomTTS/babtts/engines/British/Graham8k/Graham8k.nuul" + Coeff="/opt/Acapela/TelecomTTS/babtts/engines/British/Graham8k/Graham8k.coef" + Database="/opt/Acapela/TelecomTTS/babtts/engines/British/Graham8k/Graham8k.vco" + Info="/opt/Acapela/TelecomTTS/babtts/engines/British/Graham8k/Graham8k.nfo" + Pitch="120" Speed="100" Freq="8000"/> + <Lucy8k + Version="6_0_26213_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Lucy8k_6_0_26213_1.crc" + Base="/opt/Acapela/TelecomTTS/babtts/engines/British/Lucy8k/Lucy8k.nuul" + Coeff="/opt/Acapela/TelecomTTS/babtts/engines/British/Lucy8k/Lucy8k.coef" + Database="/opt/Acapela/TelecomTTS/babtts/engines/British/Lucy8k/Lucy8k.vco" + Info="/opt/Acapela/TelecomTTS/babtts/engines/British/Lucy8k/Lucy8k.nfo" + Pitch="200" Speed="100" Freq="8000"/> + <Salma8k + Version="6_0_26213_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Salma8k_6_0_26213_1.crc" + Base="/opt/Acapela/TelecomTTS/babtts/engines/Arabic/Salma8k/Salma8k.nuul" + Coeff="/opt/Acapela/TelecomTTS/babtts/engines/Arabic/Salma8k/Salma8k.coef" + Database="/opt/Acapela/TelecomTTS/babtts/engines/Arabic/Salma8k/Salma8k.vco" + Info="/opt/Acapela/TelecomTTS/babtts/engines/Arabic/Salma8k/Salma8k.nfo" + GLYPHS="/opt/Acapela/TelecomTTS/babtts/engines/Arabic/Salma8k/Arabic.glyph" + Pitch="180" Speed="100" Freq="8000"/> + <Mette8k + Version="6_0_26213_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Mette8k_6_0_26213_1.crc" + Base="/opt/Acapela/TelecomTTS/babtts/engines/Danish/Mette8k/Mette8k.nuul" + Coeff="/opt/Acapela/TelecomTTS/babtts/engines/Danish/Mette8k/Mette8k.coef" + Database="/opt/Acapela/TelecomTTS/babtts/engines/Danish/Mette8k/Mette8k.vco" + Info="/opt/Acapela/TelecomTTS/babtts/engines/Danish/Mette8k/Mette8k.nfo" + Pitch="190" Speed="100" Freq="8000"/> + <Femke8k + Version="6_0_26213_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Femke8k_6_0_26213_1.crc" + Base="/opt/Acapela/TelecomTTS/babtts/engines/Dutch/Femke8k/Femke8k.nuul" + Coeff="/opt/Acapela/TelecomTTS/babtts/engines/Dutch/Femke8k/Femke8k.coef" + Database="/opt/Acapela/TelecomTTS/babtts/engines/Dutch/Femke8k/Femke8k.vco" + Info="/opt/Acapela/TelecomTTS/babtts/engines/Dutch/Femke8k/Femke8k.nfo" + Pitch="180" Speed="100" Freq="8000"/> + <Kari8k + Version="6_0_26213_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Kari8k_6_0_26213_1.crc" + Base="/opt/Acapela/TelecomTTS/babtts/engines/Norwegian/Kari8k/Kari8k.nuul" + Coeff="/opt/Acapela/TelecomTTS/babtts/engines/Norwegian/Kari8k/Kari8k.coef" + Database="/opt/Acapela/TelecomTTS/babtts/engines/Norwegian/Kari8k/Kari8k.vco" + Info="/opt/Acapela/TelecomTTS/babtts/engines/Norwegian/Kari8k/Kari8k.nfo" + Pitch="200" Speed="100" Freq="8000"/> + <Maria8k + Version="6_0_26213_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Maria8k_6_0_26213_1.crc" + Base="/opt/Acapela/TelecomTTS/babtts/engines/Spanish/Maria8k/Maria8k.nuul" + Coeff="/opt/Acapela/TelecomTTS/babtts/engines/Spanish/Maria8k/Maria8k.coef" + Database="/opt/Acapela/TelecomTTS/babtts/engines/Spanish/Maria8k/Maria8k.vco" + Info="/opt/Acapela/TelecomTTS/babtts/engines/Spanish/Maria8k/Maria8k.nfo" + Pitch="200" Speed="100" Freq="8000"/> + <Erik8k + Version="6_0_26213_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Erik8k_6_0_26213_1.crc" + Base="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/Erik8k/Erik8k.nuul" + Coeff="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/Erik8k/Erik8k.coef" + Database="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/Erik8k/Erik8k.vco" + Info="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/Erik8k/Erik8k.nfo" + Pitch="100" Speed="100" Freq="8000"/> + <Emma8k + Version="6_0_26213_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Emma8k_6_0_26213_1.crc" + Base="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/Emma8k/Emma8k.nuul" + Coeff="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/Emma8k/Emma8k.coef" + Database="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/Emma8k/Emma8k.vco" + Info="/opt/Acapela/TelecomTTS/babtts/engines/Swedish/Emma8k/Emma8k.nfo" + Pitch="190" Speed="100" Freq="8000"/> + <Celia8k + Version="6_0_26213_1" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/Celia8k_6_0_26213_1.crc" + Base="/opt/Acapela/TelecomTTS/babtts/engines/Portuguese/Celia8k/Celia8k.nuul" + Coeff="/opt/Acapela/TelecomTTS/babtts/engines/Portuguese/Celia8k/Celia8k.coef" + Database="/opt/Acapela/TelecomTTS/babtts/engines/Portuguese/Celia8k/Celia8k.vco" + Info="/opt/Acapela/TelecomTTS/babtts/engines/Portuguese/Celia8k/Celia8k.nfo" + Pitch="200" Speed="100" Freq="8000"/> + </Speechfonts> + <Synthesizers> + <BrightSynth + XMLDefault="/opt/Acapela/TelecomTTS/babtts/bin/BrightSpeech.so" + Version="1_4_26213_2" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/BrightSpeech_1_4_26213_2.crc"/> + </Synthesizers> + <Modules> + <BabTTS + XMLDefault="/opt/Acapela/TelecomTTS/babtts/libacabtts.so" + Version="1_5_26213_5" + CRCFile="/opt/Acapela/TelecomTTS/babtts/BabWizard/CRCFiles/babtts_1_5_26213_5.crc"/> + </Modules> + <License + Path="/opt/Acapela/TelecomTTS/babtts/License" + Server="localhost:7777"/> +</root> Property changes on: software_suite_v2/middleware/TuxHTTPRESTServer/trunk/BabTts.conf ___________________________________________________________________ Name: svn:executable + * Added: software_suite_v2/middleware/TuxHTTPRESTServer/trunk/COPYING =================================================================== --- software_suite_v2/middleware/TuxHTTPRESTServer/trunk/COPYING (rev 0) +++ software_suite_v2/middleware/TuxHTTPRESTServer/trunk/COPYING 2008-05-19 10:01:42 UTC (rev 1173) @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. Property changes on: software_suite_v2/middleware/TuxHTTPRESTServer/trunk/COPYING ___________________________________________________________________ Name: svn:executable + * Added: software_suite_v2/middleware/TuxHTTPRESTServer/trunk/README =================================================================== --- software_suite_v2/middleware/TuxHTTPRESTServer/trunk/README (rev 0) +++ software_suite_v2/middleware/TuxHTTPRESTServer/trunk/README 2008-05-19 10:01:42 UTC (rev 1173) @@ -0,0 +1,11 @@ +Tuxdroid HTTP REST Server v0.0.1-b001 ALPHA + +Howto load it : + $python TuxDroidHTTPServer.py <port number> + example: + $python TuxDroidHTTPServer.py 81 + +For all information about tuxdroid, please visit: + + http://www.tuxisalive.com + Property changes on: software_suite_v2/middleware/TuxHTTPRESTServer/trunk/README ___________________________________________________________________ Name: svn:executable + * Added: software_suite_v2/middleware/TuxHTTPRESTServer/trunk/TuxDroidHTTPRESTServer.py =================================================================== --- software_suite_v2/middleware/TuxHTTPRESTServer/trunk/TuxDroidHTTPRESTServer.py (rev 0) +++ software_suite_v2/middleware/TuxHTTPRESTServer/trunk/TuxDroidHTTPRESTServer.py 2008-05-19 10:01:42 UTC (rev 1173) @@ -0,0 +1,207 @@ +#!/usr/bin/env python +# -*- coding: latin1 -*- + +# Tux Droid - HTTP REST server +# Copyright (C) 2008 C2ME Sa +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +from td_http_server import TDHttpServer +import td_xml +from td_services import * +from tux_driver import * +from tux_osl import * +from td_file_abstraction import FileAbstractionContainer +from td_attitunes import AttitunesFileReader, clear_attitunes_tmp_path +from version import * + +import copy +import threading +import time +import sys + +APPLICATION_PATH = os.path.realpath(os.path.dirname(sys.argv[0])) + +SW_USER_STATUSES = [ + "left_wing_button", + "right_wing_button", + "head_button", + "remote_button", +] + +# Shared objects between the http rest server and the resources +# TODO : It have surely a better way to shared this ... +m_server = None +service_container = None +client_controller = None +abstract_files_container = None +current_attitune = None + +class TuxDroidHHTPRESTServer(object): + + def __init__(self, port): + ''' + Initialization of the object + ''' + self.__ver_str = "Tuxdroid HTTP REST Server v%d.%d.%d-b%.3d(%s)" % (VER_MAJOR, + VER_MINOR, VER_UPDATE, VER_BUILD, VER_STATE) + # Print the version of the system + print self.__ver_str + # Get the server port + self.__port = port + # Load libtuxdriver and libtuxosl + if os.name == 'nt': + self.__tux_osl = TuxOSL('%s/libtuxosl.dll' % APPLICATION_PATH) + self.__tux_drv = TuxDrv('%s/libtuxdriver.dll' % APPLICATION_PATH) + else: + self.__tux_osl = TuxOSL('%s/libtuxosl.so' % APPLICATION_PATH) + self.__tux_drv = TuxDrv('%s/libtuxdriver.so' % APPLICATION_PATH) + # Configure libtuxdriver and libtuxosl + self.__tux_drv.SetLogLevel(LOG_LEVEL_ERROR) + self.__tux_drv.SetLogTarget(LOG_TARGET_TUX) + self.__tux_drv.SetStatusCallback(self.__on_status_event) + self.__tux_osl.SetStatusCallback(self.__on_status_event) + self.__tux_drv.SetDongleConnectedCallback(self.__on_dongle_connected) + self.__tux_drv.SetDongleDisconnectedCallback(self.__on_dongle_disconnected) + # Create the HTTP server + self.__http_server = TDHttpServer(port = self.__port) + # Create the container of services + self.__service_container = TDServiceContainer(self.__http_server) + # Create the controller of clients + self.__client_controller = self.__service_container.client_ctrl + # Create the container of abtract files + self.__abstract_files_container = FileAbstractionContainer() + # Clean start of the attitune temporary directory + clear_attitunes_tmp_path() + # Attitune object set to None + self.__current_attitune = None + # Load the resources an services + self.__load_resources() + # Start libtuxdriver + t = threading.Thread(target = self.__tux_drv.Start) + t.start() + # Wait 100 msec that the driver was started + time.sleep(0.1) + + def start(self): + ''' + Start the server + ''' + # Synchronous start of the http server + self.__http_server.start() + # After the killing of the http server, we must to stop the libraries + self.__tux_osl.Stop() + self.__tux_drv.Stop() + + def __on_status_event(self, status): + ''' + Callback function on status event + ''' + # Parse the structure of the status + status_struct = self.__tux_drv.GetStatusStruct(status) + # Dispatch the status + if status_struct['name'] in SW_USER_STATUSES: + self.__client_controller.push_user_events([status_struct,]) + else: + self.__client_controller.push_misc_events([status_struct,]) + # When the sound start or stop in libtuxosl, we set the correct sound channel + # in the dongle + if status_struct['name'] == "general_sound_state": + if status_struct['value'] == "ON": + cmd = "TUX_CMD:AUDIO:CHANNEL_TTS" + else: + cmd = "TUX_CMD:AUDIO:CHANNEL_GENERAL" + self.__tux_drv.PerformCommand(0.0, cmd) + + def __on_dongle_connected(self): + ''' + Callback function when the dongle is connected + ''' + # Reset the body state of tux + self.__tux_drv.ResetPositions() + # Start the osl library + self.__tux_osl.Start("Acapela") + + def __on_dongle_disconnected(self): + ''' + Callback function when the dongle is disconnected + ''' + # Stop the osl library + self.__tux_osl.Stop() + + def __load_resources(self): + ''' + Filling of resources and services in the REST view + ''' + # Shared objects between the http rest server and the resources + # TODO : It have surely a better way to shared this ... + global m_server + global service_container + global client_controller + global abstract_files_container + global current_attitune + global tux_osl + global tux_drv + + m_server = self.__http_server + service_container = self.__service_container + client_controller = self.__client_controller + abstract_files_container = self.__abstract_files_container + current_attitune = self.__current_attitune + tux_osl = self.__tux_osl + tux_drv = self.__tux_drv + + # Load the resources from the external files + str = open('%s/resources/td_resource_files.py' % APPLICATION_PATH, 'r').read() + exec(str) in globals() + str = open('%s/resources/td_resource_client.py' % APPLICATION_PATH, 'r').read() + exec(str) in globals() + str = open('%s/resources/td_resource_access.py' % APPLICATION_PATH, 'r').read() + exec(str) in globals() + str = open('%s/resources/td_resource_status.py' % APPLICATION_PATH, 'r').read() + exec(str) in globals() + str = open('%s/resources/td_resource_eyes.py' % APPLICATION_PATH, 'r').read() + exec(str) in globals() + str = open('%s/resources/td_resource_mouth.py' % APPLICATION_PATH, 'r').read() + exec(str) in globals() + str = open('%s/resources/td_resource_wings.py' % APPLICATION_PATH, 'r').read() + exec(str) in globals() + str = open('%s/resources/td_resource_spinning.py' % APPLICATION_PATH, 'r').read() + exec(str) in globals() + str = open('%s/resources/td_resource_ir.py' % APPLICATION_PATH, 'r').read() + exec(str) in globals() + str ... [truncated message content] |
From: eFfeM <c2m...@c2...> - 2008-05-19 09:46:09
|
Author: eFfeM Date: 2008-05-18 16:48:24 +0200 (Sun, 18 May 2008) New Revision: 1172 Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_sound_flash.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_usb.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_usb.h Log: added a function to export rf state fixed two spots in sound_flash that were still open Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_sound_flash.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_sound_flash.c 2008-05-18 11:35:08 UTC (rev 1171) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_sound_flash.c 2008-05-18 14:48:24 UTC (rev 1172) @@ -137,18 +137,25 @@ tux_sound_flash_update_flash_play(void) { char *new_track = ""; - char track[10] = ""; + static char track[2][10]; + static int tracktoggle = 0; + /* + the thing with track is a little bit wicked, + set_strvalue will compare on pointer so the array must be static + also we need two arrays and toggle between them otherwise we + will not get the event. + */ + tracktoggle = !tracktoggle; if (!hw_status_table.sensors1.play_internal_sound) { new_track = STRING_VALUE_STOP; } else { - // FIX THIS - sprintf(track, "TRACK_%.3d", + sprintf(track[tracktoggle], "TRACK_%.3d", hw_status_table.sensors1.play_internal_sound); - new_track = track; + new_track = track[tracktoggle]; } tux_sw_status_set_strvalue(SW_ID_AUDIO_FLASH_PLAY, new_track, true); @@ -606,9 +613,7 @@ /* Check fux connection and radio connection */ if (reflash_info.current_state != SRS_STDBY) { - // FIX THIS - //rf_state = *(bool *)tux_sw_status_get_value(SW_ID_RF_STATE); - rf_state = true; + rf_state = tux_usb_get_rf_state(); if ((!tux_usb_connected()) || (!rf_state)) { reflash_info.error = SRE_RF_OFFLINE; Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_usb.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_usb.c 2008-05-18 11:35:08 UTC (rev 1171) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_usb.c 2008-05-18 14:48:24 UTC (rev 1172) @@ -605,3 +605,13 @@ return tux_usb_send_raw(frame); } + +/** + * Get the rf state + * @param data 4 bytes array + */ +LIBLOCAL bool +tux_usb_get_rf_state(void) +{ + return last_knowed_rf_state; +} Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_usb.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_usb.h 2008-05-18 11:35:08 UTC (rev 1171) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_usb.h 2008-05-18 14:48:24 UTC (rev 1172) @@ -190,4 +190,10 @@ */ extern bool tux_usb_send_raw(const unsigned char *data); +/** + * Get the rf state + * @param data 4 bytes array + */ +extern bool tux_usb_get_rf_state(void); + #endif /* _TUX_USB_H_ */ |
From: eFfeM <c2m...@c2...> - 2008-05-18 11:35:19
|
Author: eFfeM Date: 2008-05-18 13:35:08 +0200 (Sun, 18 May 2008) New Revision: 1171 Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_battery.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_firmware.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_leds.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_light.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_sound_flash.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.h software_suite_v2/middleware/tuxdriver/trunk/src/tux_user_inputs.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c Log: mostly finished reworking sw_status (some small cleanups might still be needed) Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_battery.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_battery.c 2008-05-17 11:38:57 UTC (rev 1170) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_battery.c 2008-05-18 11:35:08 UTC (rev 1171) @@ -52,7 +52,6 @@ int new_level = 0; int adc_value; char *new_state_str = ""; - char *old_state_str = ""; int delta; adc_value = (hw_status_table.battery.high_level << 8); @@ -100,13 +99,7 @@ } } - old_state_str = (char *)tux_sw_status_get_value(SW_ID_BATTERY_STATE); - - if (strcmp(new_state_str, old_state_str)) - { - tux_sw_status_set_value(SW_ID_BATTERY_STATE, (void *)new_state_str, - true); - } + tux_sw_status_set_strvalue(SW_ID_BATTERY_STATE, new_state_str, true); } else { Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.c 2008-05-17 11:38:57 UTC (rev 1170) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.c 2008-05-18 11:35:08 UTC (rev 1171) @@ -37,7 +37,6 @@ tux_eyes_update_position(void) { char *new_position = ""; - char *old_position; if (!hw_status_table.ports.portd.bits.eyes_open_switch) { @@ -55,13 +54,7 @@ } } - old_position = (char *)tux_sw_status_get_value(SW_ID_EYES_POSITION); - - if (strcmp(new_position, old_position)) - { - tux_sw_status_set_value(SW_ID_EYES_POSITION, (void *)new_position, - true); - } + tux_sw_status_set_strvalue(SW_ID_EYES_POSITION, new_position, true); } /** Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_firmware.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_firmware.c 2008-05-17 11:38:57 UTC (rev 1170) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_firmware.c 2008-05-18 11:35:08 UTC (rev 1171) @@ -656,15 +656,15 @@ versioning_state = FINALIZE; break; case FINALIZE: - tux_sw_status_set_value(SW_ID_TUXCORE_SYMBOLIC_VERSION, + tux_sw_status_set_strvalue(SW_ID_TUXCORE_SYMBOLIC_VERSION, firmwares_desc[TUXCORE_CPU_NUM].version_string, false); - tux_sw_status_set_value(SW_ID_TUXAUDIO_SYMBOLIC_VERSION, + tux_sw_status_set_strvalue(SW_ID_TUXAUDIO_SYMBOLIC_VERSION, firmwares_desc[TUXAUDIO_CPU_NUM].version_string, false); - tux_sw_status_set_value(SW_ID_FUXUSB_SYMBOLIC_VERSION, + tux_sw_status_set_strvalue(SW_ID_FUXUSB_SYMBOLIC_VERSION, firmwares_desc[FUXUSB_CPU_NUM].version_string, false); - tux_sw_status_set_value(SW_ID_FUXRF_SYMBOLIC_VERSION, + tux_sw_status_set_strvalue(SW_ID_FUXRF_SYMBOLIC_VERSION, firmwares_desc[FUXRF_CPU_NUM].version_string, false); - tux_sw_status_set_value(SW_ID_TUXRF_SYMBOLIC_VERSION, + tux_sw_status_set_strvalue(SW_ID_TUXRF_SYMBOLIC_VERSION, firmwares_desc[TUXRF_CPU_NUM].version_string, false); tux_descriptor_update(); /* Check version of tuxcore and tuxaudio */ Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_leds.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_leds.c 2008-05-17 11:38:57 UTC (rev 1170) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_leds.c 2008-05-18 11:35:08 UTC (rev 1171) @@ -69,7 +69,6 @@ tux_leds_update_left(void) { char *new_left_state = ""; - char *old_left_state = ""; /* Get on / off state */ if (hw_status_table.led.left_led_intensity < 50) @@ -101,14 +100,7 @@ break; } - /* Get old state */ - old_left_state = (char *)tux_sw_status_get_value(SW_ID_LEFT_LED_STATE); - - /* Check if the state have changed */ - if (strcmp(new_left_state, old_left_state)) - { - tux_sw_status_set_value(SW_ID_LEFT_LED_STATE, (void *)new_left_state, true); - } + tux_sw_status_set_strvalue(SW_ID_LEFT_LED_STATE, new_left_state, true); } /** @@ -118,7 +110,6 @@ tux_leds_update_right(void) { char *new_right_state = ""; - char *old_right_state = ""; /* Get on / off state */ if (hw_status_table.led.right_led_intensity < 50) @@ -150,15 +141,7 @@ break; } - /* Get old state */ - old_right_state = (char *)tux_sw_status_get_value(SW_ID_RIGHT_LED_STATE); - - /* Check if the state have changed */ - if (strcmp(new_right_state, old_right_state)) - { - tux_sw_status_set_value(SW_ID_RIGHT_LED_STATE, - (void *)new_right_state, true); - } + tux_sw_status_set_strvalue(SW_ID_RIGHT_LED_STATE, new_right_state, true); } /** Default settings for the fading effect. */ Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_light.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_light.c 2008-05-17 11:38:57 UTC (rev 1170) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_light.c 2008-05-18 11:35:08 UTC (rev 1171) @@ -35,7 +35,6 @@ tux_light_update_level(void) { float new_level = 0.0; - float old_level = 0.0; int light_value; @@ -51,19 +50,13 @@ new_level = (light_value * 100.0) / 1128.0; - old_level = *(float *)tux_sw_status_get_value(SW_ID_LIGHT_LEVEL); - if (fabs(new_level - last_level_for_event) > 1.0) { last_level_for_event = new_level; - tux_sw_status_set_value(SW_ID_LIGHT_LEVEL, (void *)&new_level, true); + tux_sw_status_set_floatvalue(SW_ID_LIGHT_LEVEL, new_level, true); } else { - if (new_level != old_level) - { - tux_sw_status_set_value(SW_ID_LIGHT_LEVEL, (void *)&new_level, - false); - } + tux_sw_status_set_floatvalue(SW_ID_LIGHT_LEVEL, new_level, false); } } Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.c 2008-05-17 11:38:57 UTC (rev 1170) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.c 2008-05-18 11:35:08 UTC (rev 1171) @@ -37,7 +37,6 @@ tux_mouth_update_position(void) { char *new_position = ""; - char *old_position = ""; if (!hw_status_table.ports.portb.bits.mouth_open_switch) { @@ -55,13 +54,7 @@ } } - old_position = (char *)tux_sw_status_get_value(SW_ID_MOUTH_POSITION); - - if (strcmp(new_position, old_position)) - { - tux_sw_status_set_value(SW_ID_MOUTH_POSITION, - (void *)new_position, true); - } + tux_sw_status_set_strvalue(SW_ID_MOUTH_POSITION, new_position, true); } /** Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_sound_flash.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_sound_flash.c 2008-05-17 11:38:57 UTC (rev 1170) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_sound_flash.c 2008-05-18 11:35:08 UTC (rev 1171) @@ -137,7 +137,6 @@ tux_sound_flash_update_flash_play(void) { char *new_track = ""; - char *old_track = ""; char track[10] = ""; if (!hw_status_table.sensors1.play_internal_sound) @@ -146,18 +145,13 @@ } else { + // FIX THIS sprintf(track, "TRACK_%.3d", hw_status_table.sensors1.play_internal_sound); new_track = track; } - old_track = (char *)tux_sw_status_get_value(SW_ID_AUDIO_FLASH_PLAY); - - if (strcmp(new_track, old_track)) - { - tux_sw_status_set_value(SW_ID_AUDIO_FLASH_PLAY, - (void *)new_track, true); - } + tux_sw_status_set_strvalue(SW_ID_AUDIO_FLASH_PLAY, new_track, true); } /** @@ -612,7 +606,9 @@ /* Check fux connection and radio connection */ if (reflash_info.current_state != SRS_STDBY) { - rf_state = *(bool *)tux_sw_status_get_value(SW_ID_RF_STATE); + // FIX THIS + //rf_state = *(bool *)tux_sw_status_get_value(SW_ID_RF_STATE); + rf_state = true; if ((!tux_usb_connected()) || (!rf_state)) { reflash_info.error = SRE_RF_OFFLINE; @@ -629,9 +625,9 @@ /* Send begin flashing event with the fulltime of processing */ full_time_sec = 10.0 + (reflash_info.full_size / 8000.0); full_time_sec += reflash_info.wav_count * 0.97; - tux_sw_status_set_value(SW_ID_SOUND_REFLASH_BEGIN, - (void *)&full_time_sec, true); - tux_sw_status_set_value(SW_ID_SOUND_REFLASH_END, "NO_ERROR", false); + tux_sw_status_set_floatvalue(SW_ID_SOUND_REFLASH_BEGIN, + full_time_sec, true); + tux_sw_status_set_strvalue(SW_ID_SOUND_REFLASH_END, "NO_ERROR", false); /* Goto SRS_ERASE state */ reflash_info.current_state = SRS_ERASE; break; @@ -714,11 +710,11 @@ tux_leds_cmd_set(LED_BOTH, 1.0, NONE, 0, 0); /* Send end of flashing event */ full_time_sec = 0.0; - tux_sw_status_set_value(SW_ID_SOUND_REFLASH_BEGIN, - (void *)&full_time_sec, false); + tux_sw_status_set_floatvalue(SW_ID_SOUND_REFLASH_BEGIN, + full_time_sec, false); switch (reflash_info.error) { case SRE_NO_ERROR: - tux_sw_status_set_value(SW_ID_SOUND_REFLASH_END, + tux_sw_status_set_strvalue(SW_ID_SOUND_REFLASH_END, STRING_VALUE_NO_ERROR, true); log_info("Sound reflash: Finish (%s)", STRING_VALUE_NO_ERROR); @@ -726,19 +722,19 @@ tux_sound_flash_cmd_play(1, 100.0); break; case SRE_RF_OFFLINE: - tux_sw_status_set_value(SW_ID_SOUND_REFLASH_END, + tux_sw_status_set_strvalue(SW_ID_SOUND_REFLASH_END, STRING_VALUE_ERROR_RF_OFFLINE, true); log_info("Sound reflash: Finish (%s)", STRING_VALUE_ERROR_RF_OFFLINE); break; case SRE_WAV_ERROR: - tux_sw_status_set_value(SW_ID_SOUND_REFLASH_END, + tux_sw_status_set_strvalue(SW_ID_SOUND_REFLASH_END, STRING_VALUE_ERROR_WAV_ERROR, true); log_info("Sound reflash: Finish (%s)", STRING_VALUE_ERROR_WAV_ERROR); break; case SRE_USB_ERROR: - tux_sw_status_set_value(SW_ID_SOUND_REFLASH_END, + tux_sw_status_set_strvalue(SW_ID_SOUND_REFLASH_END, STRING_VALUE_ERROR_USB, true); log_info("Sound reflash: Finish (%s)", STRING_VALUE_ERROR_USB); Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.c 2008-05-17 11:38:57 UTC (rev 1170) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.c 2008-05-18 11:35:08 UTC (rev 1171) @@ -36,7 +36,6 @@ tux_spinning_update_direction(void) { char *new_direction = ""; - char *old_direction = ""; if ((!hw_status_table.ports.portb.bits.spin_motor_forward) && (!hw_status_table.ports.portb.bits.spin_motor_backward)) @@ -58,13 +57,7 @@ } } - old_direction = (char *)tux_sw_status_get_value(SW_ID_SPINNING_DIRECTION); - - if (strcmp(new_direction, old_direction)) - { - tux_sw_status_set_value(SW_ID_SPINNING_DIRECTION, - (void *)new_direction, true); - } + tux_sw_status_set_strvalue(SW_ID_SPINNING_DIRECTION, new_direction, true); } /** Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c 2008-05-17 11:38:57 UTC (rev 1170) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c 2008-05-18 11:35:08 UTC (rev 1171) @@ -18,6 +18,13 @@ * 02111-1307, USA. */ +/* +This file contains the eventing code for the tux +values stored are the last evented values (so not the current values) +there is no external function that allows retrieving that value so it +was decided not to store the current value as there was no need for it +*/ + #include <assert.h> #include <errno.h> #include <stdio.h> @@ -33,237 +40,181 @@ #include "tux_sw_status.h" #include "version.h" -LIBLOCAL sw_status_table_t sw_status_table; +/* + notes on the following struct: + - strvalue is a pointer. it should only be used for static data + - intvalue is used for bool, uint8, int8 + - event_threshold is the threshold value; if the threshold is exceeded + the value is evented; for string values 0 means not evented, + 1 means evented if string changes +*/ +typedef struct +{ + int id; + char *name; + int value_fmt; + union { + int intvalue; + float floatvalue; + const char *strvalue; + }; + int event_threshold; + const char *value_doc; + double lu_time; +} sw_status_t; #ifdef USE_MUTEX static mutex_t __status_mutex; #endif static event_callback_t event_funct; -/** - * - */ -static void -init_value_of_status(int id) -{ -#ifdef USE_MUTEX - mutex_lock(__status_mutex); -#endif - - switch(sw_status_table[id].value_fmt) { - case ID_FMT_BOOL: - sw_status_table[id].intvalue = 0; - break; - case ID_FMT_UINT8: - sw_status_table[id].intvalue = 0; - break; - case ID_FMT_INT: - sw_status_table[id].intvalue = 0; - break; - case ID_FMT_FLOAT: - sw_status_table[id].value = malloc(sizeof(float)); - *(float *)sw_status_table[id].value = 0.0; - break; - case ID_FMT_STRING: - sw_status_table[id].value = malloc(256); - break; - } +#define INIT_FLOATID(id, value_fmt, name, value_doc, initval, threshold) \ + { id, name, value_fmt, {.floatvalue = initval}, threshold, value_doc, 0.0 }, +#define INIT_INTID(id, value_fmt, name, value_doc, initval, threshold) \ + { id, name, value_fmt, {.intvalue = initval}, threshold, value_doc, 0.0 }, +#define INIT_STRINGID(id, value_fmt, name, value_doc, initval, threshold) \ + { id, name, value_fmt, {.strvalue = initval}, threshold, value_doc, 0.0 }, -#ifdef USE_MUTEX - mutex_unlock(__status_mutex); -#endif -} - -/** - * - */ -static void -init_status_struct(int id, int value_fmt, const char *name, - const char *value_doc) -{ - if ((id < 0) || (id >= SW_STATUS_NUMBER)) - { - return; - } -#ifdef USE_MUTEX - mutex_lock(__status_mutex); -#endif - sw_status_table[id].id = id; - sw_status_table[id].value_fmt = value_fmt; - strcpy(sw_status_table[id].name, name); - sw_status_table[id].lu_time = get_time(); - tux_sw_status_name_from_id(id, sw_status_table[id].name); - // do we want this define or not? -//#ifdef GENERATE_DOC - strcpy(sw_status_table[id].value_doc, value_doc); -//#endif -#ifdef USE_MUTEX - mutex_unlock(__status_mutex); -#endif - - init_value_of_status(id); -} - -/** - * - */ -LIBLOCAL void -tux_sw_status_init(void) -{ - char driver_symbolic_version[128] = ""; - -#ifdef USE_MUTEX - mutex_init(__status_mutex); -#endif - - sprintf(driver_symbolic_version, "Tux_driver_%d.%d.%d - b%.3d (%s) (%s)", - VER_MAJOR, - VER_MINOR, - VER_UPDATE, - VER_BUILD, - VER_STATE, - VER_ARCH); +sw_status_t sw_status_table[SW_STATUS_NUMBER] = { + INIT_STRINGID(SW_ID_WINGS_POSITION, ID_FMT_STRING, + "wings_position", "DOWN|UP", STRING_VALUE_DOWN, 1) - init_status_struct(SW_ID_WINGS_POSITION, ID_FMT_STRING, - "wings_position", "DOWN|UP"); - tux_sw_status_set_value(SW_ID_WINGS_POSITION, STRING_VALUE_DOWN, - false); - - init_status_struct(SW_ID_WINGS_REMAINING_MVM, ID_FMT_UINT8, - "wings_remaining_movements", "range[0..255]"); + INIT_INTID(SW_ID_WINGS_REMAINING_MVM, ID_FMT_UINT8, + "wings_remaining_movements", "range[0..255]", 0, 1) - init_status_struct(SW_ID_SPINNING_DIRECTION, ID_FMT_STRING, - "spinning_direction", "NONE|LEFT|RIGHT"); - tux_sw_status_set_value(SW_ID_SPINNING_DIRECTION, STRING_VALUE_NONE, - false); + INIT_STRINGID(SW_ID_SPINNING_DIRECTION, ID_FMT_STRING, + "spinning_direction", "NONE|LEFT|RIGHT", STRING_VALUE_NONE, 1) - init_status_struct(SW_ID_SPINNING_REMAINING_MVM, ID_FMT_UINT8, - "spinning_remaining_movements", "range[0..255]"); + INIT_INTID(SW_ID_SPINNING_REMAINING_MVM, ID_FMT_UINT8, + "spinning_remaining_movements", "range[0..255]", 0, 1) - init_status_struct(SW_ID_LEFT_WING_BUTTON, ID_FMT_BOOL, - "left_wing_button", "False|True"); + INIT_INTID(SW_ID_LEFT_WING_BUTTON, ID_FMT_BOOL, + "left_wing_button", "False|True", 0, 1) - init_status_struct(SW_ID_RIGHT_WING_BUTTON, ID_FMT_BOOL, - "right_wing_button", "False|True"); + INIT_INTID(SW_ID_RIGHT_WING_BUTTON, ID_FMT_BOOL, + "right_wing_button", "False|True", 0, 1) - init_status_struct(SW_ID_HEAD_BUTTON, ID_FMT_BOOL, - "head_button", "False|True"); + INIT_INTID(SW_ID_HEAD_BUTTON, ID_FMT_BOOL, + "head_button", "False|True", 0, 1) - init_status_struct(SW_ID_REMOTE_BUTTON, ID_FMT_STRING, - "remote_button", "K_<remote button>|RELEASE"); - tux_sw_status_set_value(SW_ID_REMOTE_BUTTON, STRING_VALUE_RELEASE, - false); + INIT_STRINGID(SW_ID_REMOTE_BUTTON, ID_FMT_STRING, + "remote_button", "K_<remote button>|RELEASE", STRING_VALUE_RELEASE, 1) - init_status_struct(SW_ID_MOUTH_POSITION, ID_FMT_STRING, - "mouth_position", "OPEN|CLOSE|NDEF"); - tux_sw_status_set_value(SW_ID_MOUTH_POSITION, STRING_VALUE_CLOSE, - false); + INIT_STRINGID(SW_ID_MOUTH_POSITION, ID_FMT_STRING, + "mouth_position", "OPEN|CLOSE|NDEF", STRING_VALUE_CLOSE, 1) - init_status_struct(SW_ID_MOUTH_REMAINING_MVM, ID_FMT_UINT8, - "mouth_remaining_movements", "range[0..255]"); + INIT_INTID(SW_ID_MOUTH_REMAINING_MVM, ID_FMT_UINT8, + "mouth_remaining_movements", "range[0..255]", 0, 1) - init_status_struct(SW_ID_EYES_POSITION, ID_FMT_STRING, - "eyes_position", "OPEN|CLOSE|NDEF"); - tux_sw_status_set_value(SW_ID_EYES_POSITION, STRING_VALUE_CLOSE, - false); + INIT_STRINGID(SW_ID_EYES_POSITION, ID_FMT_STRING, + "eyes_position", "OPEN|CLOSE|NDEF", STRING_VALUE_CLOSE, 1) - init_status_struct(SW_ID_EYES_REMAINING_MVM, ID_FMT_UINT8, - "eyes_remaining_movements", "range[0..255]"); + INIT_INTID(SW_ID_EYES_REMAINING_MVM, ID_FMT_UINT8, + "eyes_remaining_movements", "range[0..255]", 0, 1) - init_status_struct(SW_ID_DESCRIPTOR_COMPLETE, ID_FMT_BOOL, - "descriptor_complete", "True"); + INIT_INTID(SW_ID_DESCRIPTOR_COMPLETE, ID_FMT_BOOL, + "descriptor_complete", "True", 0, 1) - init_status_struct(SW_ID_RF_STATE, ID_FMT_BOOL, - "radio_state", "False|True"); + INIT_INTID(SW_ID_RF_STATE, ID_FMT_BOOL, + "radio_state", "False|True", 0, 1) - init_status_struct(SW_ID_DONGLE_PLUG, ID_FMT_BOOL, - "dongle_plug", "False|True"); + INIT_INTID(SW_ID_DONGLE_PLUG, ID_FMT_BOOL, + "dongle_plug", "False|True", 0, 1) - init_status_struct(SW_ID_CHARGER_STATE, ID_FMT_STRING, + INIT_STRINGID(SW_ID_CHARGER_STATE, ID_FMT_STRING, "charger_state", - "UNPLUGGED|CHARGING|PLUGGED_NO_POWER|TRICKLE|INHIBITED"); - tux_sw_status_set_value(SW_ID_CHARGER_STATE, STRING_VALUE_UNPLUGGED, - false); + "UNPLUGGED|CHARGING|PLUGGED_NO_POWER|TRICKLE|INHIBITED", + STRING_VALUE_UNPLUGGED, 1) - init_status_struct(SW_ID_BATTERY_LEVEL, ID_FMT_INT, - "battery_level", "range[4000..6500] (mV)"); + INIT_INTID(SW_ID_BATTERY_LEVEL, ID_FMT_INT, + "battery_level", "range[4000..6500] (mV)", 0, 1) - init_status_struct(SW_ID_BATTERY_STATE, ID_FMT_STRING, - "battery_state", "EMPTY|LOW|HIGH|FULL"); - tux_sw_status_set_value(SW_ID_BATTERY_STATE, STRING_VALUE_EMPTY, - false); + INIT_STRINGID(SW_ID_BATTERY_STATE, ID_FMT_STRING, + "battery_state", "EMPTY|LOW|HIGH|FULL", STRING_VALUE_EMPTY, 1) - init_status_struct(SW_ID_LIGHT_LEVEL, ID_FMT_FLOAT, - "light_level", "range[0.0..100.0]"); + INIT_INTID(SW_ID_LIGHT_LEVEL, ID_FMT_FLOAT, + "light_level", "range[0.0..100.0]", 0.0, 1000) - init_status_struct(SW_ID_LEFT_LED_STATE, ID_FMT_STRING, - "left_led_state", "ON|OFF|CHANGING"); - tux_sw_status_set_value(SW_ID_LEFT_LED_STATE, STRING_VALUE_OFF, - false); + INIT_STRINGID(SW_ID_LEFT_LED_STATE, ID_FMT_STRING, + "left_led_state", "ON|OFF|CHANGING", STRING_VALUE_OFF, 1) - init_status_struct(SW_ID_RIGHT_LED_STATE, ID_FMT_STRING, - "right_led_state", "ON|OFF|CHANGING"); - tux_sw_status_set_value(SW_ID_RIGHT_LED_STATE, STRING_VALUE_OFF, - false); + INIT_STRINGID(SW_ID_RIGHT_LED_STATE, ID_FMT_STRING, + "right_led_state", "ON|OFF|CHANGING", STRING_VALUE_OFF, 1) - init_status_struct(SW_ID_CONNECTION_QUALITY, ID_FMT_INT, - "connection_quality", "range[0..100]"); + INIT_INTID(SW_ID_CONNECTION_QUALITY, ID_FMT_INT, + "connection_quality", "range[0..100]", 0, 1) - init_status_struct(SW_ID_AUDIO_FLASH_PLAY, ID_FMT_STRING, - "audio_flash_play", "TRACK_<range[0..255]>|STOP"); - tux_sw_status_set_value(SW_ID_AUDIO_FLASH_PLAY, STRING_VALUE_STOP, - false); + INIT_STRINGID(SW_ID_AUDIO_FLASH_PLAY, ID_FMT_STRING, + "audio_flash_play", "TRACK_<range[0..255]>|STOP", STRING_VALUE_STOP, 1) - init_status_struct(SW_ID_AUDIO_GENERAL_PLAY, ID_FMT_BOOL, - "audio_general_play", "False|True"); + INIT_INTID(SW_ID_AUDIO_GENERAL_PLAY, ID_FMT_BOOL, + "audio_general_play", "False|True", 0, 1) - init_status_struct(SW_ID_FLASH_PROG_CURR_TRACK, ID_FMT_UINT8, - "flash_programming_current_track", "range[0..255]"); + INIT_INTID(SW_ID_FLASH_PROG_CURR_TRACK, ID_FMT_UINT8, + "flash_programming_current_track", "range[0..255]", 0, 1) - init_status_struct(SW_ID_FLASH_PROG_LAST_TRACK_SIZE, ID_FMT_INT, - "flash_programming_last_track_size", "<track size>"); + INIT_INTID(SW_ID_FLASH_PROG_LAST_TRACK_SIZE, ID_FMT_INT, + "flash_programming_last_track_size", "<track size>", 0, 1) - init_status_struct(SW_ID_TUXCORE_SYMBOLIC_VERSION, ID_FMT_STRING, - "tuxcore_symbolic_version", "<string>"); - tux_sw_status_set_value(SW_ID_TUXCORE_SYMBOLIC_VERSION, - knowed_tuxcore_symbolic_version, false); + INIT_STRINGID(SW_ID_TUXCORE_SYMBOLIC_VERSION, ID_FMT_STRING, + "tuxcore_symbolic_version", "<string>", + knowed_tuxcore_symbolic_version, 1) - init_status_struct(SW_ID_TUXAUDIO_SYMBOLIC_VERSION, ID_FMT_STRING, - "tuxaudio_symbolic_version", "<string>"); - tux_sw_status_set_value(SW_ID_TUXAUDIO_SYMBOLIC_VERSION, - knowed_tuxaudio_symbolic_version, false); + INIT_STRINGID(SW_ID_TUXAUDIO_SYMBOLIC_VERSION, ID_FMT_STRING, + "tuxaudio_symbolic_version", "<string>", + knowed_tuxaudio_symbolic_version, 1) - init_status_struct(SW_ID_FUXUSB_SYMBOLIC_VERSION, ID_FMT_STRING, - "fuxusb_symbolic_version", "<string>"); - tux_sw_status_set_value(SW_ID_FUXUSB_SYMBOLIC_VERSION, - knowed_fuxusb_symbolic_version, false); + INIT_STRINGID(SW_ID_FUXUSB_SYMBOLIC_VERSION, ID_FMT_STRING, + "fuxusb_symbolic_version", "<string>", + knowed_fuxusb_symbolic_version, 1) - init_status_struct(SW_ID_FUXRF_SYMBOLIC_VERSION, ID_FMT_STRING, - "fuxrf_symbolic_version", "<string>"); - tux_sw_status_set_value(SW_ID_FUXRF_SYMBOLIC_VERSION, - knowed_fuxrf_symbolic_version, false); + INIT_STRINGID(SW_ID_FUXRF_SYMBOLIC_VERSION, ID_FMT_STRING, + "fuxrf_symbolic_version", "<string>", + knowed_fuxrf_symbolic_version, 1) - init_status_struct(SW_ID_TUXRF_SYMBOLIC_VERSION, ID_FMT_STRING, - "tuxrf_symbolic_version", "<string>"); - tux_sw_status_set_value(SW_ID_TUXRF_SYMBOLIC_VERSION, - knowed_tuxrf_symbolic_version, false); + INIT_STRINGID(SW_ID_TUXRF_SYMBOLIC_VERSION, ID_FMT_STRING, + "tuxrf_symbolic_version", "<string>", + knowed_tuxrf_symbolic_version, 1) - init_status_struct(SW_ID_DRIVER_SYMBOLIC_VERSION, ID_FMT_STRING, - "driver_symbolic_version", "<string>"); - tux_sw_status_set_value(SW_ID_DRIVER_SYMBOLIC_VERSION, - driver_symbolic_version, false); + INIT_STRINGID(SW_ID_DRIVER_SYMBOLIC_VERSION, ID_FMT_STRING, + "driver_symbolic_version", "<string>", + "", 1) - init_status_struct(SW_ID_SOUND_REFLASH_BEGIN, ID_FMT_FLOAT, - "sound_reflash_begin", "<seconds>"); + INIT_FLOATID(SW_ID_SOUND_REFLASH_BEGIN, ID_FMT_FLOAT, + "sound_reflash_begin", "<seconds>", 0.0, 1000) - init_status_struct(SW_ID_SOUND_REFLASH_END, ID_FMT_STRING, - "sound_reflash_end", "NO_ERROR|ERROR_RF_OFFLINE|ERROR_WAV|ERROR_USB"); - tux_sw_status_set_value(SW_ID_SOUND_REFLASH_END, - STRING_VALUE_NO_ERROR, false); + INIT_STRINGID(SW_ID_SOUND_REFLASH_END, ID_FMT_STRING, + "sound_reflash_end", "NO_ERROR|ERROR_RF_OFFLINE|ERROR_WAV|ERROR_USB", + STRING_VALUE_NO_ERROR, 1) - init_status_struct(SW_ID_SOUND_REFLASH_CURRENT_TRACK, ID_FMT_UINT8, - "sound_reflash_current_track", "range[0..255]"); + INIT_INTID(SW_ID_SOUND_REFLASH_CURRENT_TRACK, ID_FMT_UINT8, + "sound_reflash_current_track", "range[0..255]", 0, 1) +}; +/** + * + */ +LIBLOCAL void +tux_sw_status_init(void) +{ + char driver_symbolic_version[128] = ""; + +#ifdef USE_MUTEX + mutex_init(__status_mutex); +#endif + + sprintf(driver_symbolic_version, "Tux_driver_%d.%d.%d - b%.3d (%s) (%s)", + VER_MAJOR, + VER_MINOR, + VER_UPDATE, + VER_BUILD, + VER_STATE, + VER_ARCH); + + tux_sw_status_set_strvalue(SW_ID_DRIVER_SYMBOLIC_VERSION, + driver_symbolic_version, false); + + #ifdef GENERATE_DOC tux_sw_status_dump_status_doc(); #endif @@ -364,10 +315,10 @@ sprintf(str, "%d", sw_status_table[id].intvalue); break; case ID_FMT_FLOAT: - sprintf(str, "%f", *(float *)sw_status_table[id].value); + sprintf(str, "%f", sw_status_table[id].floatvalue); break; case ID_FMT_STRING: - strcpy(str, (char *)sw_status_table[id].value); + strcpy(str, sw_status_table[id].strvalue); break; default: break; @@ -500,52 +451,44 @@ * */ LIBLOCAL void -tux_sw_status_set_value(int id, const void *value, bool make_event) +tux_sw_status_set_floatvalue(int id, float value, bool make_event) { - char state_str[1024] = ""; - + float delta; + char state_str[1024]; + + if (make_event) + { #ifdef USE_MUTEX - mutex_lock(__status_mutex); + mutex_lock(__status_mutex); #endif - switch(sw_status_table[id].value_fmt) { - case ID_FMT_BOOL: - assert("set_value: should not happen"); - *(unsigned char *)sw_status_table[id].value = *(unsigned char *)value; - break; - case ID_FMT_UINT8: - assert("set_value: should not happen"); - *(unsigned char *)sw_status_table[id].value = *(unsigned char *)value; - break; - case ID_FMT_INT: - assert("set_value: should not happen"); - *(int *)sw_status_table[id].value = *(int *)value; - break; - case ID_FMT_FLOAT: - *(float *)sw_status_table[id].value = *(float *)value; - break; - case ID_FMT_STRING: - strcpy((char *)sw_status_table[id].value, (char *)value); - break; - } + delta = sw_status_table[id].floatvalue - value; + if (delta < 0) + { + delta = -delta; + } + #ifdef USE_MUTEX - mutex_unlock(__status_mutex); + mutex_unlock(__status_mutex); #endif - tux_sw_status_get_state_str(id, state_str); - - if (make_event) - { if (event_funct) { - event_funct(state_str); + if ((1000*delta) >= sw_status_table[id].event_threshold) + { + sw_status_table[id].floatvalue = value; + tux_sw_status_get_state_str(id, state_str); + event_funct(state_str); + } } } #ifdef USE_MUTEX mutex_lock(__status_mutex); #endif + sw_status_table[id].lu_time = get_time(); + #ifdef USE_MUTEX mutex_unlock(__status_mutex); #endif @@ -554,42 +497,57 @@ /** * */ -LIBLOCAL void * -tux_sw_status_get_value(int id) +LIBLOCAL void +tux_sw_status_set_strvalue(int id, const char *value, bool make_event) { - void *value = NULL; + char state_str[1024]; + + if (make_event) + { +#ifdef USE_MUTEX + mutex_lock(__status_mutex); +#endif + + +#ifdef USE_MUTEX + mutex_unlock(__status_mutex); +#endif + if (event_funct) + { + /* + the next if statement uses pointer comparison + this works like a charm under the following two conditions + - value points to a string constants (and not variables) + - no duplicate string constants (althought the compiler might + pick up this one anyway). + If the first condition is not met, we need to copy the string + instead of the pointer (and allocate space for it), + (or resolve it in the caller, not really a nice solution) + If the second condtion is not met something like: + ((sw_status_table[id].strvalue == NULL) || + strcmp(sw_status_table[id].strvalue,value))) + could be done instead of the value != line) + */ + if (sw_status_table[id].event_threshold && + (value != sw_status_table[id].strvalue)) + { + sw_status_table[id].strvalue = value; + tux_sw_status_get_state_str(id, state_str); + event_funct(state_str); + } + } + } + #ifdef USE_MUTEX mutex_lock(__status_mutex); #endif - switch(sw_status_table[id].value_fmt) - { - case ID_FMT_BOOL: - assert("get_value: should not happen"); - value = sw_status_table[id].value; - break; - case ID_FMT_UINT8: - assert("get_value: should not happen"); - value = sw_status_table[id].value; - break; - case ID_FMT_INT: - assert("get_value: should not happen"); - value = sw_status_table[id].value; - break; - case ID_FMT_FLOAT: - value = sw_status_table[id].value; - break; - case ID_FMT_STRING: - value = sw_status_table[id].value; - break; - default: - break; - } + + sw_status_table[id].lu_time = get_time(); + #ifdef USE_MUTEX mutex_unlock(__status_mutex); #endif - - return value; } /** Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.h 2008-05-17 11:38:57 UTC (rev 1170) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.h 2008-05-18 11:35:08 UTC (rev 1171) @@ -105,35 +105,10 @@ typedef void(*event_callback_t)(char *event); -/* - notes on the following struct: - - strvalue is a pointer. it should only be used for static data - - intvalue is used for bool, uint8, int8 - - event_threshold is the threshold value; if the threshold is exceeded - the value is evented; for string values 0 means not evented, - 1 means evented if string changes -*/ -typedef struct -{ - int id; - char name[128]; - int value_fmt; - void *value; - int event_threshold; - int intvalue; - const char *strvalue; - char value_doc[1024]; - double lu_time; -} sw_status_t; - -typedef sw_status_t sw_status_table_t[SW_STATUS_NUMBER]; - -extern sw_status_table_t sw_status_table; - extern void tux_sw_status_init(void); -extern void tux_sw_status_set_value(int id, const void *value, bool make_event); extern void tux_sw_status_set_intvalue(int id, int value, bool make_event); -extern void *tux_sw_status_get_value(int id); +extern void tux_sw_status_set_strvalue(int id, const char *value, bool make_event); +extern void tux_sw_status_set_floatvalue(int id, float value, bool make_event); extern TuxDrvError tux_sw_status_name_from_id(int id, char* name); extern TuxDrvError tux_sw_status_id_from_name(const char* name, int *id); extern const char *tux_sw_status_value_fmt_from_id(int id); Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_user_inputs.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_user_inputs.c 2008-05-17 11:38:57 UTC (rev 1170) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_user_inputs.c 2008-05-18 11:35:08 UTC (rev 1171) @@ -204,8 +204,7 @@ { /* remote button is released */ code_str = RC5_code_to_str(K_DUMMY_RELEASE); - tux_sw_status_set_value(SW_ID_REMOTE_BUTTON, - (void *)code_str, true); + tux_sw_status_set_strvalue(SW_ID_REMOTE_BUTTON, code_str, true); rc5_timeout_counter = 0; rc5_on_receiving = false; @@ -220,15 +219,13 @@ { /* remote button is released */ code_str = RC5_code_to_str(K_DUMMY_RELEASE); - tux_sw_status_set_value(SW_ID_REMOTE_BUTTON, - (void *)code_str, true); + tux_sw_status_set_strvalue(SW_ID_REMOTE_BUTTON, code_str, true); /* remote button is pressed */ if (hw_status_table.ir.rc5_code.bits.command <= LAST_VALID_K) { code_str = RC5_code_to_str(hw_status_table.ir.rc5_code.bits.command); - tux_sw_status_set_value(SW_ID_REMOTE_BUTTON, - (void *)code_str, true); + tux_sw_status_set_strvalue(SW_ID_REMOTE_BUTTON, code_str, true); } else { @@ -250,8 +247,7 @@ if (hw_status_table.ir.rc5_code.bits.command <= LAST_VALID_K) { code_str = RC5_code_to_str(hw_status_table.ir.rc5_code.bits.command); - tux_sw_status_set_value(SW_ID_REMOTE_BUTTON, - (void *)code_str, true); + tux_sw_status_set_strvalue(SW_ID_REMOTE_BUTTON, code_str, true); } else { @@ -281,10 +277,7 @@ tux_user_inputs_update_charger_state(void) { char *new_state = ""; - char *old_state = ""; - old_state = (char *)tux_sw_status_get_value(SW_ID_CHARGER_STATE); - if (!hw_status_table.sensors1.sensors.bits.power_plug_insertion_switch) { new_state = STRING_VALUE_UNPLUGGED; @@ -303,22 +296,12 @@ } else { - if (strcmp(STRING_VALUE_UNPLUGGED, old_state)) - { - new_state = STRING_VALUE_TRICKLE; - } - else - { - new_state = STRING_VALUE_UNPLUGGED; - } + new_state = STRING_VALUE_TRICKLE; } } } - if (strcmp(new_state, old_state)) - { - tux_sw_status_set_value(SW_ID_CHARGER_STATE, (void *)new_state, true); - } + tux_sw_status_set_strvalue(SW_ID_CHARGER_STATE, new_state, true); } /** Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c 2008-05-17 11:38:57 UTC (rev 1170) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c 2008-05-18 11:35:08 UTC (rev 1171) @@ -36,7 +36,6 @@ tux_wings_update_position(void) { char *new_position = ""; - char *old_position = ""; if (!hw_status_table.position2.wings_down) { @@ -47,13 +46,7 @@ new_position = STRING_VALUE_UP; } - old_position = (char *)tux_sw_status_get_value(SW_ID_WINGS_POSITION); - - if (strcmp(new_position, old_position)) - { - tux_sw_status_set_value(SW_ID_WINGS_POSITION, - (void *)new_position, true); - } + tux_sw_status_set_strvalue(SW_ID_WINGS_POSITION, new_position, true); } /** |
From: eFfeM <c2m...@c2...> - 2008-05-17 11:39:08
|
Author: eFfeM Date: 2008-05-17 13:38:57 +0200 (Sat, 17 May 2008) New Revision: 1170 Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_battery.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_descriptor.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_driver.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_pong.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_sound_flash.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.h software_suite_v2/middleware/tuxdriver/trunk/src/tux_user_inputs.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c Log: reworked a lot of the status handling now handle the eventing in tux_sw_status.c for this in sw_status_t the following fields have been introduced: - event_threshold (to record the delta after which an event is done) - intvalue (to store integer values) - strvalue (to store string values) (not used yet). reworked ID_FMT_BOOL, ID_FMT_UINT8 and ID_FMT_INT to use these new value removed ID_FMT_INT8 (was not used) todo: string and float these changes also remove a lot of typecasts and some small mallocs Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_battery.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_battery.c 2008-05-16 14:32:08 UTC (rev 1169) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_battery.c 2008-05-17 11:38:57 UTC (rev 1170) @@ -50,7 +50,6 @@ tux_battery_update_level(void) { int new_level = 0; - int old_level = 0; int adc_value; char *new_state_str = ""; char *old_state_str = ""; @@ -63,16 +62,13 @@ 1000 is to go to mV */ - old_level = *(int *)tux_sw_status_get_value(SW_ID_BATTERY_LEVEL); - delta = new_level - last_level_for_event; if ((delta > REPORTING_DELTA) || (delta < -REPORTING_DELTA)) { last_level_for_event = new_level; if (!hw_status_table.battery.motors_state) { - tux_sw_status_set_value(SW_ID_BATTERY_LEVEL, - (void *)&new_level, true); + tux_sw_status_set_intvalue(SW_ID_BATTERY_LEVEL, new_level, true); } if (new_level >= TUX_BATTERY_FULL_VALUE) @@ -114,10 +110,6 @@ } else { - if (old_level != new_level) - { - tux_sw_status_set_value(SW_ID_BATTERY_LEVEL, (void *)&new_level, - false); - } + tux_sw_status_set_intvalue(SW_ID_BATTERY_LEVEL, new_level, false); } } Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_descriptor.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_descriptor.c 2008-05-16 14:32:08 UTC (rev 1169) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_descriptor.c 2008-05-17 11:38:57 UTC (rev 1170) @@ -43,9 +43,7 @@ LIBLOCAL void tux_descriptor_get(void) { - bool tmp_bool = false; - - tux_sw_status_set_value(SW_ID_DESCRIPTOR_COMPLETE, (void *)&tmp_bool, false); + tux_sw_status_set_intvalue(SW_ID_DESCRIPTOR_COMPLETE, false, false); tux_id_get_descriptor(); tux_firmware_get_descriptor(); tux_sound_flash_get_descripor(); @@ -119,9 +117,7 @@ LIBLOCAL void tux_descriptor_update(void) { - bool tmp_bool = true; - check_tux_has_changed(); - tux_sw_status_set_value(SW_ID_DESCRIPTOR_COMPLETE, (void *)&tmp_bool, true); + tux_sw_status_set_intvalue(SW_ID_DESCRIPTOR_COMPLETE, true, false); tux_descriptor_dump(); } Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_driver.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_driver.c 2008-05-16 14:32:08 UTC (rev 1169) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_driver.c 2008-05-17 11:38:57 UTC (rev 1170) @@ -208,7 +208,7 @@ static void on_rf_state(unsigned char state) { - tux_sw_status_set_value(SW_ID_RF_STATE, (void *)&state, true); + tux_sw_status_set_intvalue(SW_ID_RF_STATE, state, true); if (state) { tux_descriptor_get(); @@ -223,14 +223,12 @@ static void on_usb_connect(void) { - bool state = true; - tux_descriptor_init(); tux_hw_status_init(); tux_sw_status_init(); tux_user_inputs_init(); tux_cmd_parser_init(); - tux_sw_status_set_value(SW_ID_DONGLE_PLUG, (void *)&state, true); + tux_sw_status_set_intvalue(SW_ID_DONGLE_PLUG, true, true); if (dongle_connected_funct) { dongle_connected_funct(); @@ -243,8 +241,7 @@ static void on_usb_disconnect(void) { - bool state = false; - tux_sw_status_set_value(SW_ID_DONGLE_PLUG, (void *)&state, true); + tux_sw_status_set_intvalue(SW_ID_DONGLE_PLUG, false, true); if (dongle_disconnected_funct) { dongle_disconnected_funct(); Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.c 2008-05-16 14:32:08 UTC (rev 1169) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.c 2008-05-17 11:38:57 UTC (rev 1170) @@ -70,16 +70,11 @@ LIBLOCAL void tux_eyes_update_movements_remaining(void) { - unsigned char old_count, new_count; + unsigned char new_count; new_count = hw_status_table.position1.eyes_remaining_mvm; - old_count = *(unsigned char *)tux_sw_status_get_value(SW_ID_EYES_REMAINING_MVM); - if (new_count != old_count) - { - tux_sw_status_set_value(SW_ID_EYES_REMAINING_MVM, - (void *)&new_count, true); - } + tux_sw_status_set_intvalue(SW_ID_EYES_REMAINING_MVM, new_count, true); } /** Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.c 2008-05-16 14:32:08 UTC (rev 1169) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.c 2008-05-17 11:38:57 UTC (rev 1170) @@ -70,16 +70,11 @@ LIBLOCAL void tux_mouth_update_movements_remaining(void) { - unsigned char old_count, new_count; + unsigned char new_count; new_count = hw_status_table.position1.mouth_remaining_mvm; - old_count = *(unsigned char *)tux_sw_status_get_value(SW_ID_MOUTH_REMAINING_MVM); - if (new_count != old_count) - { - tux_sw_status_set_value(SW_ID_MOUTH_REMAINING_MVM, - (void *)&new_count, true); - } + tux_sw_status_set_intvalue(SW_ID_MOUTH_REMAINING_MVM, new_count, true); } /** Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_pong.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_pong.c 2008-05-16 14:32:08 UTC (rev 1169) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_pong.c 2008-05-17 11:38:57 UTC (rev 1170) @@ -78,7 +78,6 @@ { static unsigned char received_pong = 0; int average; - int last_average; received_pong++; @@ -88,12 +87,7 @@ { stack_insert(received_pong * 10); average = stack_average(); - last_average = *(int *)tux_sw_status_get_value(SW_ID_CONNECTION_QUALITY); - if (average != last_average) - { - tux_sw_status_set_value(SW_ID_CONNECTION_QUALITY, - (void *)&average, true); - } + tux_sw_status_set_intvalue(SW_ID_CONNECTION_QUALITY, average, true); } received_pong = 0; } Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_sound_flash.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_sound_flash.c 2008-05-16 14:32:08 UTC (rev 1169) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_sound_flash.c 2008-05-17 11:38:57 UTC (rev 1170) @@ -166,17 +166,12 @@ LIBLOCAL void tux_sound_flash_update_general_play(void) { - unsigned char old_state, new_state; + unsigned char new_state; new_state = hw_status_table.sensors1.play_general_sound; new_state |= hw_status_table.sensors1.play_internal_sound; - old_state = *(unsigned char *)tux_sw_status_get_value(SW_ID_AUDIO_GENERAL_PLAY); - if (new_state != old_state) - { - tux_sw_status_set_value(SW_ID_AUDIO_GENERAL_PLAY, - (void *)&new_state, true); - } + tux_sw_status_set_intvalue(SW_ID_AUDIO_GENERAL_PLAY, new_state, true); } /** @@ -185,16 +180,11 @@ LIBLOCAL void tux_sound_flash_update_prog_current_track(void) { - unsigned char old_track, new_track; + unsigned char new_track; new_track = hw_status_table.flash_prog.current_state; - old_track = *(unsigned char *)tux_sw_status_get_value(SW_ID_FLASH_PROG_CURR_TRACK); - if (new_track != old_track) - { - tux_sw_status_set_value(SW_ID_FLASH_PROG_CURR_TRACK, - (void *)&new_track, true); - } + tux_sw_status_set_intvalue(SW_ID_FLASH_PROG_CURR_TRACK, new_track, true); } /** @@ -203,16 +193,11 @@ LIBLOCAL void tux_sound_flash_update_prog_last_track_size(void) { - int old_size, new_size; + int new_size; new_size = hw_status_table.flash_prog.last_sound_size; - old_size = *(int *)tux_sw_status_get_value(SW_ID_FLASH_PROG_LAST_TRACK_SIZE); - if (new_size != old_size) - { - tux_sw_status_set_value(SW_ID_FLASH_PROG_LAST_TRACK_SIZE, - (void *)&new_size, true); - } + tux_sw_status_set_intvalue(SW_ID_FLASH_PROG_LAST_TRACK_SIZE, new_size, true); } /** @@ -685,8 +670,8 @@ break; } curr_track_for_event = reflash_info.current_wav + 1; - tux_sw_status_set_value(SW_ID_SOUND_REFLASH_CURRENT_TRACK, - (void *)&curr_track_for_event, true); + tux_sw_status_set_intvalue(SW_ID_SOUND_REFLASH_CURRENT_TRACK, + curr_track_for_event, true); usleep(200000); /* Play current wav track */ if (!play_wav(reflash_info.wav_path[reflash_info.current_wav])) Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.c 2008-05-16 14:32:08 UTC (rev 1169) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.c 2008-05-17 11:38:57 UTC (rev 1170) @@ -73,16 +73,11 @@ LIBLOCAL void tux_spinning_update_movements_remaining(void) { - unsigned char old_count, new_count; + unsigned char new_count; new_count = hw_status_table.position2.spin_remaining_mvm; - old_count = *(unsigned char *)tux_sw_status_get_value(SW_ID_SPINNING_REMAINING_MVM); - if (new_count != old_count) - { - tux_sw_status_set_value(SW_ID_SPINNING_REMAINING_MVM, - (void *)&new_count, true); - } + tux_sw_status_set_intvalue(SW_ID_SPINNING_REMAINING_MVM, new_count, true); } /** Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c 2008-05-16 14:32:08 UTC (rev 1169) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c 2008-05-17 11:38:57 UTC (rev 1170) @@ -18,6 +18,7 @@ * 02111-1307, USA. */ +#include <assert.h> #include <errno.h> #include <stdio.h> #include <string.h> @@ -51,20 +52,13 @@ switch(sw_status_table[id].value_fmt) { case ID_FMT_BOOL: - sw_status_table[id].value = malloc(sizeof(unsigned char)); - *(unsigned char *)sw_status_table[id].value = false; + sw_status_table[id].intvalue = 0; break; case ID_FMT_UINT8: - sw_status_table[id].value = malloc(sizeof(unsigned char)); - *(unsigned char *)sw_status_table[id].value = 0; + sw_status_table[id].intvalue = 0; break; - case ID_FMT_INT8: - sw_status_table[id].value = malloc(sizeof(char)); - *(char *)sw_status_table[id].value = 0; - break; case ID_FMT_INT: - sw_status_table[id].value = malloc(sizeof(int)); - *(int *)sw_status_table[id].value = 0; + sw_status_table[id].intvalue = 0; break; case ID_FMT_FLOAT: sw_status_table[id].value = malloc(sizeof(float)); @@ -331,8 +325,6 @@ return "bool"; case ID_FMT_UINT8: return "uint8"; - case ID_FMT_INT8: - return "int8"; case ID_FMT_INT: return "int"; case ID_FMT_FLOAT: @@ -344,6 +336,7 @@ } } +#include "log.h" /** * */ @@ -355,7 +348,7 @@ #endif switch (sw_status_table[id].value_fmt) { case ID_FMT_BOOL: - if (*(unsigned char *)sw_status_table[id].value) + if (sw_status_table[id].intvalue) { strcpy(str, "True"); } @@ -365,14 +358,10 @@ } break; case ID_FMT_UINT8: - sprintf(str, "%d", - *(unsigned char *)sw_status_table[id].value); + sprintf(str, "%d", sw_status_table[id].intvalue); break; - case ID_FMT_INT8: - sprintf(str, "%d", *(char *)sw_status_table[id].value); - break; case ID_FMT_INT: - sprintf(str, "%d", *(int *)sw_status_table[id].value); + sprintf(str, "%d", sw_status_table[id].intvalue); break; case ID_FMT_FLOAT: sprintf(str, "%f", *(float *)sw_status_table[id].value); @@ -464,6 +453,53 @@ * */ LIBLOCAL void +tux_sw_status_set_intvalue(int id, int value, bool make_event) +{ + int delta; + char state_str[1024]; + + if (make_event) + { +#ifdef USE_MUTEX + mutex_lock(__status_mutex); +#endif + + delta = sw_status_table[id].intvalue - value; + if (delta < 0) + { + delta = -delta; + } + +#ifdef USE_MUTEX + mutex_unlock(__status_mutex); +#endif + + if (event_funct) + { + if (delta >= sw_status_table[id].event_threshold) + { + sw_status_table[id].intvalue = value; + tux_sw_status_get_state_str(id, state_str); + event_funct(state_str); + } + } + } + +#ifdef USE_MUTEX + mutex_lock(__status_mutex); +#endif + + sw_status_table[id].lu_time = get_time(); + +#ifdef USE_MUTEX + mutex_unlock(__status_mutex); +#endif +} + +/** + * + */ +LIBLOCAL void tux_sw_status_set_value(int id, const void *value, bool make_event) { char state_str[1024] = ""; @@ -474,15 +510,15 @@ switch(sw_status_table[id].value_fmt) { case ID_FMT_BOOL: + assert("set_value: should not happen"); *(unsigned char *)sw_status_table[id].value = *(unsigned char *)value; break; case ID_FMT_UINT8: + assert("set_value: should not happen"); *(unsigned char *)sw_status_table[id].value = *(unsigned char *)value; break; - case ID_FMT_INT8: - *(char *)sw_status_table[id].value = *(char *)value; - break; case ID_FMT_INT: + assert("set_value: should not happen"); *(int *)sw_status_table[id].value = *(int *)value; break; case ID_FMT_FLOAT: @@ -529,15 +565,15 @@ switch(sw_status_table[id].value_fmt) { case ID_FMT_BOOL: + assert("get_value: should not happen"); value = sw_status_table[id].value; break; case ID_FMT_UINT8: + assert("get_value: should not happen"); value = sw_status_table[id].value; break; - case ID_FMT_INT8: - value = sw_status_table[id].value; - break; case ID_FMT_INT: + assert("get_value: should not happen"); value = sw_status_table[id].value; break; case ID_FMT_FLOAT: Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.h 2008-05-16 14:32:08 UTC (rev 1169) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.h 2008-05-17 11:38:57 UTC (rev 1170) @@ -96,7 +96,6 @@ typedef enum { ID_FMT_BOOL = 0, ID_FMT_UINT8, - ID_FMT_INT8, ID_FMT_INT, ID_FMT_FLOAT, ID_FMT_STRING, @@ -106,12 +105,23 @@ typedef void(*event_callback_t)(char *event); +/* + notes on the following struct: + - strvalue is a pointer. it should only be used for static data + - intvalue is used for bool, uint8, int8 + - event_threshold is the threshold value; if the threshold is exceeded + the value is evented; for string values 0 means not evented, + 1 means evented if string changes +*/ typedef struct { int id; char name[128]; int value_fmt; void *value; + int event_threshold; + int intvalue; + const char *strvalue; char value_doc[1024]; double lu_time; } sw_status_t; @@ -122,6 +132,7 @@ extern void tux_sw_status_init(void); extern void tux_sw_status_set_value(int id, const void *value, bool make_event); +extern void tux_sw_status_set_intvalue(int id, int value, bool make_event); extern void *tux_sw_status_get_value(int id); extern TuxDrvError tux_sw_status_name_from_id(int id, char* name); extern TuxDrvError tux_sw_status_id_from_name(const char* name, int *id); Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_user_inputs.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_user_inputs.c 2008-05-16 14:32:08 UTC (rev 1169) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_user_inputs.c 2008-05-17 11:38:57 UTC (rev 1170) @@ -52,16 +52,11 @@ LIBLOCAL void tux_user_inputs_update_left_wing_button(void) { - unsigned char old_state, new_state; + unsigned char new_state; new_state = hw_status_table.sensors1.sensors.bits.left_wing_push_button; - old_state = *(unsigned char *)tux_sw_status_get_value(SW_ID_LEFT_WING_BUTTON); - if (new_state != old_state) - { - tux_sw_status_set_value(SW_ID_LEFT_WING_BUTTON, - (void *)&new_state, true); - } + tux_sw_status_set_intvalue(SW_ID_LEFT_WING_BUTTON, new_state, true); } /** @@ -70,16 +65,11 @@ LIBLOCAL void tux_user_inputs_update_right_wing_button(void) { - unsigned char old_state, new_state; + unsigned char new_state; new_state = hw_status_table.sensors1.sensors.bits.right_wing_push_button; - old_state = *(unsigned char *)tux_sw_status_get_value(SW_ID_RIGHT_WING_BUTTON); - if (new_state != old_state) - { - tux_sw_status_set_value(SW_ID_RIGHT_WING_BUTTON, - (void *)&new_state, true); - } + tux_sw_status_set_intvalue(SW_ID_RIGHT_WING_BUTTON, new_state, true); } /** @@ -88,15 +78,11 @@ LIBLOCAL void tux_user_inputs_update_head_button(void) { - unsigned char old_state, new_state; + unsigned char new_state; new_state = hw_status_table.sensors1.sensors.bits.head_push_button; - old_state = *(unsigned char *)tux_sw_status_get_value(SW_ID_HEAD_BUTTON); - - if (new_state != old_state) - { - tux_sw_status_set_value(SW_ID_HEAD_BUTTON, (void *)&new_state, true); - } + + tux_sw_status_set_intvalue(SW_ID_HEAD_BUTTON, new_state, true); } /** Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c 2008-05-16 14:32:08 UTC (rev 1169) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c 2008-05-17 11:38:57 UTC (rev 1170) @@ -62,16 +62,11 @@ LIBLOCAL void tux_wings_update_movements_remaining(void) { - unsigned char old_count, new_count; + unsigned char new_count; new_count = hw_status_table.position1.wings_remaining_mvm; - old_count = *(unsigned char *)tux_sw_status_get_value(SW_ID_WINGS_REMAINING_MVM); - if (new_count != old_count) - { - tux_sw_status_set_value(SW_ID_WINGS_REMAINING_MVM, - (void *)&new_count, true); - } + tux_sw_status_set_intvalue(SW_ID_WINGS_REMAINING_MVM, new_count, true); } /** |
From: Paul_R <c2m...@c2...> - 2008-05-16 14:32:44
|
Author: Paul_R Date: 2008-05-16 16:32:08 +0200 (Fri, 16 May 2008) New Revision: 1169 Modified: firmware/fuxusb/trunk/src/fifo_mic.c firmware/fuxusb/trunk/src/fifo_spk.c firmware/fuxusb/trunk/src/fifo_stt.c firmware/fuxusb/trunk/src/usb_enum.c firmware/fuxusb/trunk/src/usb_task.h Log: * Improved comments Modified: firmware/fuxusb/trunk/src/fifo_mic.c =================================================================== --- firmware/fuxusb/trunk/src/fifo_mic.c 2008-05-16 14:06:01 UTC (rev 1168) +++ firmware/fuxusb/trunk/src/fifo_mic.c 2008-05-16 14:32:08 UTC (rev 1169) @@ -29,18 +29,33 @@ #include "global.h" #include "fifo_mic.h" +/** \name Fifo's constants + * @{ */ +/** Buffer size */ #define FIFOTBL_MIC_MAX 52 +/** Overload value */ #define FIFO_MIC_OVERLOAD FIFOTBL_MIC_MAX - 1 +/** Ready threshold. This value allow to fill the fifo */ #define FIFO_MIC_READY_VALUE 32 +/*! @} */ +/** \name Variables + * \brief Theses variables are located on data or idata section for a short + * access time. + * @{ */ +/** Fifo buffer */ uint8_t FifoTbl_MIC[FIFOTBL_MIC_MAX]; - +/** In index */ uint8_t data FifoIn_MIC_Idx; +/** Out index */ uint8_t data FifoOut_MIC_Idx; +/** Out counter */ uint8_t data FifoOut_MIC_cmpt; +/** Fifo ready flag. + \ingroup fifo_mic */ +bit data Fifoready_MIC = 0; +/*! @} */ -bit Fifoready_MIC = 0; - /** * This function reset all indexes and the byte counter. * \ingroup fifo_mic Modified: firmware/fuxusb/trunk/src/fifo_spk.c =================================================================== --- firmware/fuxusb/trunk/src/fifo_spk.c 2008-05-16 14:06:01 UTC (rev 1168) +++ firmware/fuxusb/trunk/src/fifo_spk.c 2008-05-16 14:32:08 UTC (rev 1169) @@ -29,20 +29,35 @@ #include "fifo_spk.h" #include "lib_mcu\usb\usb_drv.h" - +/** \name Fifo's constants + * @{ */ +/** Buffer size */ #define FIFOTBL_SPK_MAX 52 +/** Overload value */ #define FIFO_SPK_OVERLOAD FIFOTBL_SPK_MAX +/** Ready threshold. This value allow to empty the fifo */ #define FIFO_SPK_READY_VALUE_MAX 32 +/** Too low level threshold. This value disable to empty the fifo */ #define FIFO_SPK_READY_VALUE_MIN 16 +/*! @} */ +/** \name Variables + * \brief Theses variables are located on data or idata section for a short + * access time. + * @{ */ +/** Fifo buffer */ uint8_t idata FifoTbl_SPK[FIFOTBL_SPK_MAX]; - +/** In index */ uint8_t data FifoIn_SPK_Idx; +/** Out index */ uint8_t data FifoOut_SPK_Idx; +/** Out counter */ uint8_t data FifoOut_SPK_cmpt; +/** Fifo ready flag. + \ingroup fifo_spk */ +bit data Fifoready_SPK = False; +/*! @} */ -bit data Fifoready_SPK = 0; - /** * \brief Init the Speaker FIFO. * This function reset all indexes and the byte counter. Modified: firmware/fuxusb/trunk/src/fifo_stt.c =================================================================== --- firmware/fuxusb/trunk/src/fifo_stt.c 2008-05-16 14:06:01 UTC (rev 1168) +++ firmware/fuxusb/trunk/src/fifo_stt.c 2008-05-16 14:32:08 UTC (rev 1169) @@ -28,15 +28,30 @@ #include "config.h" #include "fifo_stt.h" +/** \name Fifo's constants + * @{ */ +/** Buffer size */ #define FIFOTBL_STT_MAX 60 +/** Overload value */ #define FIFO_STT_OVERLOAD FIFOTBL_STT_MAX +/*! @} */ +/** \name Variables + * \brief Theses variables are located on data or idata section for a short + * access time. + * @{ */ +/** Fifo buffer */ uint8_t idata FifoTbl_STT[FIFOTBL_STT_MAX]; +/** In index */ uint8_t data FifoIn_STT_Idx; +/** Out index */ uint8_t data FifoOut_STT_Idx; +/** Out counter */ uint8_t data FifoOut_STT_cmpt; - +/** Fifo ready flag. + \ingroup fifo_stt */ bit data FifoOverLoad_STT = 0; +/*! @} */ /** * This function reset all indexes and the byte counter. Modified: firmware/fuxusb/trunk/src/usb_enum.c =================================================================== --- firmware/fuxusb/trunk/src/usb_enum.c 2008-05-16 14:06:01 UTC (rev 1168) +++ firmware/fuxusb/trunk/src/usb_enum.c 2008-05-16 14:32:08 UTC (rev 1169) @@ -36,15 +36,26 @@ #include "lib_mcu\usb\usb_drv.h" -uint8_t usb_configuration_nb = 0; - +/** \name Variables + * @{ */ +/** Zero length packet flag */ static bit zlp; +/** Endpoints status */ static uint8_t endpoint_status[3]; +/** Idle duration (HID specific) */ static uint8_t hid_idle_duration; +/** pointer for descriptors buffers */ static uint8_t *pbuffer; +/** bmRequestType value */ static uint8_t bmRequestType; -static uint8_t bRequest; +/** bRequest value */ +static uint8_t bRequest; +/** Configuration number : 1 = configured + * \ingroup usb_enum */ +uint8_t usb_configuration_nb = 0; +/*! @} */ + static void usb_get_descriptor(void); static void usb_read_request(void); static void usb_set_address(void); @@ -75,6 +86,9 @@ static void stall_request(void); static void send_zlp(void); +/** \name Init functions + * @{ */ + /** * \brief Init usb variables. * This function init the endpoints status, clear the configuration flag and @@ -115,7 +129,10 @@ usb_configure_endpoint(EP_CMD_OUT, INTERRUPT_OUT); usb_reset_endpoint(EP_CMD_OUT); } +/*! @} */ +/** \name Main function + * @{ */ /** * \brief Enumeration process - main function. * This is the only one public function for the enumeration process. @@ -127,7 +144,11 @@ Usb_select_ep(EP_CONTROL); usb_read_request(); } +/*! @} */ +/** \name Standard enumeration functions + * @{ */ + /** * \brief Read the USB request. * This function parse the bmRequestType and bRequest. It determine the request @@ -724,8 +745,10 @@ } } } +/*! @} */ -/* AUDIO SPECIFIC REQUESTS */ +/** \name Audio specific section + * @{ */ /** * \brief Get current setting attribute. @@ -930,9 +953,12 @@ printf("SET RES %BX %BX %BX %BX Answer",LwValue,HwValue,LwIndex,HwIndex); #endif } +/*! @} */ -/* HID SPECIFIC REQUESTS */ +/** \name HID specific functions + * @{ */ + /** * \brief HID_SET_REPORT request. * This function is used to receive a report using a control transfert. @@ -978,8 +1004,10 @@ Usb_clear_rx(); Usb_clear_DIR(); } +/*! @} */ -/* MISC FUNCTIONS */ +/** \name Misc. functions + * @{ */ /** * \brief Send a stall request. (handshake). @@ -1001,3 +1029,4 @@ while (!(Usb_tx_complete())); Usb_clear_tx_complete(); } +/*! @} */ Modified: firmware/fuxusb/trunk/src/usb_task.h =================================================================== --- firmware/fuxusb/trunk/src/usb_task.h 2008-05-16 14:06:01 UTC (rev 1168) +++ firmware/fuxusb/trunk/src/usb_task.h 2008-05-16 14:32:08 UTC (rev 1169) @@ -28,8 +28,6 @@ #ifndef _USB_TASK_H_ #define _USB_TASK_H_ -extern uint8_t RF_Status; - void usb_task_init(void); void usb_task(void); |
From: Paul_R <c2m...@c2...> - 2008-05-16 14:06:06
|
Author: Paul_R Date: 2008-05-16 16:06:01 +0200 (Fri, 16 May 2008) New Revision: 1168 Modified: firmware/fuxusb/trunk/src/config.h firmware/fuxusb/trunk/src/fifo_mic.h firmware/fuxusb/trunk/src/fifo_spk.h firmware/fuxusb/trunk/src/fifo_stt.h firmware/fuxusb/trunk/src/global.h firmware/fuxusb/trunk/src/main.c firmware/fuxusb/trunk/src/usb_desc.h firmware/fuxusb/trunk/src/usb_enum.c firmware/fuxusb/trunk/src/usb_enum.h firmware/fuxusb/trunk/src/usb_task.c firmware/fuxusb/trunk/src/usb_task.h Log: * Added doxygen comments on usb_task and usb_enum. * Moved doxygen groups def. on global.h Modified: firmware/fuxusb/trunk/src/config.h =================================================================== --- firmware/fuxusb/trunk/src/config.h 2008-05-16 13:31:45 UTC (rev 1167) +++ firmware/fuxusb/trunk/src/config.h 2008-05-16 14:06:01 UTC (rev 1168) @@ -30,7 +30,7 @@ #include <stdio.h> /* Enable the HID interface */ -#define HID_DEVICE +//#define HID_DEVICE /* Debug modes : Don't forget to define MAIN_DEBUG to be able to use printf */ //#define MAIN_DEBUG Modified: firmware/fuxusb/trunk/src/fifo_mic.h =================================================================== --- firmware/fuxusb/trunk/src/fifo_mic.h 2008-05-16 13:31:45 UTC (rev 1167) +++ firmware/fuxusb/trunk/src/fifo_mic.h 2008-05-16 14:06:01 UTC (rev 1168) @@ -20,18 +20,6 @@ /* $Id$ */ -/** - * \defgroup fifo_mic Microphone FIFO. - \brief FIFO_MIC used for the microphone data, received from the RF and sent - to the computer. - - This FIFO are specific for this application and the context. - It's optimized for speed. It's not circular, and the access to the - buffer are direct. - - \ingroup fuxusb - */ - /** \file fifo_mic.h \brief Publics declaration for the microphone's fifo module. \ingroup fifo_mic Modified: firmware/fuxusb/trunk/src/fifo_spk.h =================================================================== --- firmware/fuxusb/trunk/src/fifo_spk.h 2008-05-16 13:31:45 UTC (rev 1167) +++ firmware/fuxusb/trunk/src/fifo_spk.h 2008-05-16 14:06:01 UTC (rev 1168) @@ -19,17 +19,7 @@ /* $Id$ */ -/** - * \defgroup fifo_spk Speaker FIFO. - \brief FIFO_SPK is used for the speaker data, received from the USB and sent - to the RF. - - This FIFO are specific for this application and the context. - It's optimized for speed. It's not circular, and the access to the - buffer are direct. - \ingroup fuxusb - */ /** \file fifo_spk.h \brief Publics declaration for the speaker's fifo module. Modified: firmware/fuxusb/trunk/src/fifo_stt.h =================================================================== --- firmware/fuxusb/trunk/src/fifo_stt.h 2008-05-16 13:31:45 UTC (rev 1167) +++ firmware/fuxusb/trunk/src/fifo_stt.h 2008-05-16 14:06:01 UTC (rev 1168) @@ -22,17 +22,7 @@ #ifndef _FIFO_STT_H_ #define _FIFO_STT_H_ -/** - * \defgroup fifo_stt Statuses FIFO. - \brief FIFO_STT is used for the statuses data, received from the RF and sent - to the computer. - - This FIFO are specific for this application and the context. - It's optimized for speed. It's not circular, and the access to the - buffer are direct. - \ingroup fuxusb - */ /** \file fifo_stt.h \brief Publics declaration for the microphone's fifo module. Modified: firmware/fuxusb/trunk/src/global.h =================================================================== --- firmware/fuxusb/trunk/src/global.h 2008-05-16 13:31:45 UTC (rev 1167) +++ firmware/fuxusb/trunk/src/global.h 2008-05-16 14:06:01 UTC (rev 1168) @@ -25,29 +25,69 @@ /** \defgroup fuxusb USB Dongle for TuxDroid. */ + /** \defgroup main Main function. + * \brief Fuxusb main function + * \ingroup fuxusb + */ + +/** + * \defgroup usb_task USB Task + \brief Main functions to control the USB bus. + + \ingroup fuxusb + */ +/** + * \defgroup usb_enum USB enumeration process + \brief This module analyse the enumeration requests and send back required + informations. + + \ingroup fuxusb + */ + /** \mainpage Fuxusb firmware documentation of the Tux Droid open source robot * * \section SVN SVN repository * http://svn.tuxisalive.com/firmware/fuxusb/trunk */ +/** + * \defgroup fifo_spk Speaker FIFO. + \brief FIFO_SPK is used for the speaker data, received from the USB and sent + to the RF. + + This FIFO are specific for this application and the context. + It's optimized for speed. It's not circular, and the access to the + buffer are direct. -/** \defgroup fifo Tux USB dongle FIFOs. + \ingroup fuxusb + */ - The dongle use three FIFOs : - - FIFO_MIC used for the microphone data, received from the RF and sent to the - computer - - FIFO_SPK used for the speaker data, received from the USB and sent to - Tux - - FIFO_STT used for the statuses +/** + * \defgroup fifo_mic Microphone FIFO. + \brief FIFO_MIC used for the microphone data, received from the RF and sent + to the computer. + + This FIFO are specific for this application and the context. + It's optimized for speed. It's not circular, and the access to the + buffer are direct. - These FIFOs are specific for this application and the context - They're optimized for speed - They're not circular, and the access to the buffers are direct - */ + \ingroup fuxusb + */ + /** + * \defgroup fifo_stt Status FIFO. + \brief FIFO_STT is used for the status data, received from the RF and sent + to the computer. + + This FIFO are specific for this application and the context. + It's optimized for speed. It's not circular, and the access to the + buffer are direct. + \ingroup fuxusb + */ + + #include "common\api.h" #include "common\defines.h" Modified: firmware/fuxusb/trunk/src/main.c =================================================================== --- firmware/fuxusb/trunk/src/main.c 2008-05-16 13:31:45 UTC (rev 1167) +++ firmware/fuxusb/trunk/src/main.c 2008-05-16 14:06:01 UTC (rev 1168) @@ -20,11 +20,8 @@ /* $Id$ */ -/** \defgroup main Main function. - * \brief Fuxusb main function - * \ingroup fuxusb - */ + /** \file main.c * \brief Fuxusb main function * \ingroup main Modified: firmware/fuxusb/trunk/src/usb_desc.h =================================================================== --- firmware/fuxusb/trunk/src/usb_desc.h 2008-05-16 13:31:45 UTC (rev 1167) +++ firmware/fuxusb/trunk/src/usb_desc.h 2008-05-16 14:06:01 UTC (rev 1168) @@ -33,6 +33,8 @@ #define INTERFACE 0x04 #define ENDPOINT 0x05 +/* HID specifics descriptors */ + /* Standard features*/ #define DEVICE_REMOTE_WAKEUP_FEATURE 0x01 #define ENDPOINT_HALT_FEATURE 0x00 Modified: firmware/fuxusb/trunk/src/usb_enum.c =================================================================== --- firmware/fuxusb/trunk/src/usb_enum.c 2008-05-16 13:31:45 UTC (rev 1167) +++ firmware/fuxusb/trunk/src/usb_enum.c 2008-05-16 14:06:01 UTC (rev 1168) @@ -19,6 +19,11 @@ /* $Id$ */ +/** \file usb_enum.c + \brief Function to control the enumeration process + * \ingroup usb_enum +*/ + #include "config.h" #include "global.h" #include "version.h" @@ -74,6 +79,7 @@ * \brief Init usb variables. * This function init the endpoints status, clear the configuration flag and * clear the Bank variables. + * \ingroup usb_enum */ void usb_var_init (void) { @@ -114,6 +120,7 @@ * \brief Enumeration process - main function. * This is the only one public function for the enumeration process. * The CONTROL EP is selected, and the request can be parsed. + * \ingroup usb_enum */ void usb_enumeration_process (void) { Modified: firmware/fuxusb/trunk/src/usb_enum.h =================================================================== --- firmware/fuxusb/trunk/src/usb_enum.h 2008-05-16 13:31:45 UTC (rev 1167) +++ firmware/fuxusb/trunk/src/usb_enum.h 2008-05-16 14:06:01 UTC (rev 1168) @@ -19,61 +19,108 @@ /* $Id$ */ + +/** \file usb_enum.h + \brief Specifics define forthe enumeration process and public defs. + \ingroup usb_enum +*/ + #ifndef _USB_ENUM_H_ #define _USB_ENUM_H_ -/* USB Standard request */ +/** \name USB Requests + * @{ */ + +/** \name USB Standard requests + * @{ */ +/** Get status request */ #define GET_STATUS 0x00 +/** Get device request */ #define GET_DEVICE 0x01 +/** Clear feature request */ #define CLEAR_FEATURE 0x01 /* see FEATURES below */ +/** Get string request */ #define GET_STRING 0x03 +/** Set feature request */ #define SET_FEATURE 0x03 /* see FEATURES below */ +/** Set address request */ #define SET_ADDRESS 0x05 +/** Get descriptor request */ #define GET_DESCRIPTOR 0x06 +/** Set descriptor request */ #define SET_DESCRIPTOR 0x07 +/** Get configuration request */ #define GET_CONFIGURATION 0x08 +/** Set configuration request */ #define SET_CONFIGURATION 0x09 +/** Get interface request */ #define GET_INTERFACE 0x0A +/** Set interface request */ #define SET_INTERFACE 0x0B +/** Synchro frame request */ #define SYNCH_FRAME 0x0C +/*! @} */ -/* HID specific */ +/** \name HID specific requests + * @{ */ +/** Set idle request */ #define HID_SET_IDLE 0x0A +/** Get idle request */ #define HID_GET_IDLE 0x02 +/*! @} */ -/* USB audio specific*/ +/** \name Audio specific requests + * @{ */ +/** Set current request */ #define SET_CURRENT 0x01 +/** Set min request */ #define SET_MIN 0x02 +/** Set max request */ #define SET_MAX 0x03 +/** Set resolution request */ #define SET_RES 0x04 +/** Get current request */ #define GET_CURRENT 0x81 +/** Get min request */ #define GET_MIN 0x82 +/** Get max request */ #define GET_MAX 0x83 +/** Get resolution request */ #define GET_RES 0x84 +/*! @} */ +/*! @} */ -#define GET_DEVICE_DESCRIPTOR 1 -#define GET_CONFIGURATION_DESCRIPTOR 4 - -/* HID specific */ -#define HID 0x21 -#define REPORT 0x22 - +/** \name Status requests + * @{ */ +/** Device status request */ #define REQUEST_DEVICE_STATUS 0x80 +/** Interface status request */ #define REQUEST_INTERFACE_STATUS 0x81 +/** Endpoint status request */ #define REQUEST_ENDPOINT_STATUS 0x82 +/*! @} */ +/** \name Set feature requests + * @{ */ +/** Zero type request */ #define ZERO_TYPE 0x00 +/** Interface type request */ #define INTERFACE_TYPE 0x01 +/** Endpoint type request */ #define ENDPOINT_TYPE 0x02 +/*! @} */ -/* MASKS */ +/** \name Misc - Masks + * @{ */ +/** Class mask */ #define CLASS_MK 0x60 +/** Standard request mask */ #define STANDARD 0x00 +/** Audio specific request mask */ #define AUDIO 0x20 -/*_____ D E C L A R A T I O N ______________________________________________*/ +/*! @} */ - void usb_var_init(void); void usb_ep_init(void); void usb_enumeration_process(void); Modified: firmware/fuxusb/trunk/src/usb_task.c =================================================================== --- firmware/fuxusb/trunk/src/usb_task.c 2008-05-16 13:31:45 UTC (rev 1167) +++ firmware/fuxusb/trunk/src/usb_task.c 2008-05-16 14:06:01 UTC (rev 1168) @@ -19,6 +19,12 @@ /* $Id$ */ +/** \file usb_task.c + \brief Main USB task. + This module control the USB bus. + \ingroup usb_task +*/ + #include "config.h" #include "global.h" #include "usb_task.h" @@ -29,6 +35,11 @@ #include "misc.h" #include "lib_mcu\usb\usb_drv.h" +/** + * \brief Init the USB task. + * This function init the USB communication. + * \ingroup usb_task + */ void usb_task_init(void) { configure_usb_clock(); @@ -46,7 +57,12 @@ Led_0_off(); } - +/** + * \brief Main USB function. + * This function parse the differents USB flags and registers bit, and determine + * which function must be executed. + * \ingroup usb_task + */ void usb_task(void) { if (Usb_resume()) Modified: firmware/fuxusb/trunk/src/usb_task.h =================================================================== --- firmware/fuxusb/trunk/src/usb_task.h 2008-05-16 13:31:45 UTC (rev 1167) +++ firmware/fuxusb/trunk/src/usb_task.h 2008-05-16 14:06:01 UTC (rev 1168) @@ -17,14 +17,17 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id:$ */ +/* $Id$ */ + + +/** \file usb_task.h + \brief Publics declaration for the usb_task module. + \ingroup usb_task +*/ + #ifndef _USB_TASK_H_ #define _USB_TASK_H_ - -#define UT_REQUESTED 0 -#define UT_BLANK 1 - extern uint8_t RF_Status; void usb_task_init(void); |
From: Paul_R <c2m...@c2...> - 2008-05-16 13:32:06
|
Author: Paul_R Date: 2008-05-16 15:31:45 +0200 (Fri, 16 May 2008) New Revision: 1167 Modified: firmware/hex_dev/fuxusb.hex Log: * Current version of fuxusb from trunk @rev 1166 compiled for current tuxsetup. Modified: firmware/hex_dev/fuxusb.hex =================================================================== (Binary files differ) |
From: Paul_R <c2m...@c2...> - 2008-05-16 13:08:38
|
Author: Paul_R Date: 2008-05-16 15:08:02 +0200 (Fri, 16 May 2008) New Revision: 1166 Modified: firmware/fuxusb/trunk/src/config.h firmware/fuxusb/trunk/src/usb_desc.c firmware/fuxusb/trunk/src/usb_desc.h firmware/fuxusb/trunk/src/usb_enum.c Log: * Removed the directive to compile with/without the TTS interface * Added a directive to compile a HID or LIBUSB device (see config.h - HID_DEVICE) Modified: firmware/fuxusb/trunk/src/config.h =================================================================== --- firmware/fuxusb/trunk/src/config.h 2008-05-16 10:25:56 UTC (rev 1165) +++ firmware/fuxusb/trunk/src/config.h 2008-05-16 13:08:02 UTC (rev 1166) @@ -29,8 +29,8 @@ #include "lib_mcu/5131_drv.h" #include <stdio.h> -/* Enable the TTS interface */ -#define TTS_INTERFACE_ENABLED +/* Enable the HID interface */ +#define HID_DEVICE /* Debug modes : Don't forget to define MAIN_DEBUG to be able to use printf */ //#define MAIN_DEBUG @@ -77,13 +77,13 @@ (0x0001*VER_MAJOR) /* CONFIGURATION DESCRIPTOR */ -#define SIZE_OF_REPORT 0x22 -#ifdef TTS_INTERFACE_ENABLED +#ifdef HID_DEVICE +# define SIZE_OF_REPORT 0x22 # define CONF_LENGTH 0x2901 // 297 # define NB_INTERFACE 6 #else -# define CONF_LENGTH 0xCE00 // 206 -# define NB_INTERFACE 4 +# define CONF_LENGTH 0x2001 // 288 +# define NB_INTERFACE 6 #endif #define CONF_NB 1 Modified: firmware/fuxusb/trunk/src/usb_desc.c =================================================================== --- firmware/fuxusb/trunk/src/usb_desc.c 2008-05-16 10:25:56 UTC (rev 1165) +++ firmware/fuxusb/trunk/src/usb_desc.c 2008-05-16 13:08:02 UTC (rev 1166) @@ -321,7 +321,7 @@ 0x00, // bLockDelayUnits Unused 0x0000 // LockDelay }, - +#ifdef HID_DEVICE //------------------------------------------------------------------------- // "HID" LIB USB //------------------------------------------------------------------------- @@ -366,7 +366,49 @@ 0x4000, // Maximum packet size 0x01 // Polling interval }, -#ifdef TTS_INTERFACE_ENABLED +#else + //---------------------------------------------------------------------------- + // "HID" LIB USB + //---------------------------------------------------------------------------- + // Interface 3 :: Command / Status Interface + //-------------------------------------------------------------------------- + + // HIDInterfaceDescriptor[] = + //------------------------------------- + { + 0x09, // length of descriptor (9 bytes) + 0x04, // descriptor type (INTERFACE) + 0x03, // interface number Index of this interface + 0x00, // alternate setting Index of this alternate setting + 0x02, // number of endpoints + 0x00, // interface class HID + 0x00, // interface sub-class + 0x00, // interface protocol + 0x00 // interface string index + }, + + // HID_InEndpointDescriptor[] = + //------------------------------------- + { + 0x07, // descriptor length (7 bytes) + 0x05, // descriptor type + IN_ENDPOINT4, + 0x03, // bMAttributes (interrupt) bit 7 :: max paket + 0x4000, // Max packet size (64 Bytes) + 0x01 // polling interval 1ms + }, + // HID_OutEndpointDescriptor[] = + //------------------------------------- + { + 0x07, // descriptor length (7 bytes) + 0x05, // descriptor type + OUT_ENDPOINT5, + 0x03, // bMAttributes (interrupt) bit 7 :: max paket + 0x4000, // Max packet size (64 Bytes) + 0x01 // polling interval 1ms + }, +#endif + //------------------------------------------------------------------------- // Audio //------------------------------------------------------------------------- @@ -509,9 +551,11 @@ 0x01, // DescriptorSubType GENERAL subtype 0x00, // bMAttributes bit 7 :: max paket 0x00, // bLockDelayUnits Unused - 0x0000 // LockDelay + 0x0000 // LockDelay +#ifndef HID_DEVICE + } +#else }, -#endif //------------------------------------------------------------------------- // HID Report descriptor //------------------------------------------------------------------------- @@ -537,5 +581,6 @@ 0x91, 0x02, // output (data, variable, absolute) 0xC0 // End collection - } + } +#endif }; Modified: firmware/fuxusb/trunk/src/usb_desc.h =================================================================== --- firmware/fuxusb/trunk/src/usb_desc.h 2008-05-16 10:25:56 UTC (rev 1165) +++ firmware/fuxusb/trunk/src/usb_desc.h 2008-05-16 13:08:02 UTC (rev 1166) @@ -402,12 +402,17 @@ //------------------------------------------------------------------------- // Interface 3 :: Command / Status Interface //------------------------------------------------------------------------- +#ifdef HID_DEVICE struct usb_st_interface_descriptor HIDInterfaceDescriptor; struct usb_hid_descriptor HIDStandardDescriptor; struct usb_st_endpoint_descriptor HID_InEndpointDescriptor; struct usb_st_endpoint_descriptor HID_OutEndpointDescriptor; +#else + struct usb_st_interface_descriptor HIDInterfaceDescriptor; + struct usb_st_endpoint_descriptor HID_InEndpointDescriptor; + struct usb_st_endpoint_descriptor HID_OutEndpointDescriptor; +#endif -#ifdef TTS_INTERFACE_ENABLED // Interface 4 :: Audio Control //------------------------------------------------------------------------- struct usb_Audio_st_ACinterface_descriptor StandardACInterfaceDescriptor_TTS; @@ -423,11 +428,12 @@ struct usb_Audio_TYPEI_FormatType_descriptor SpkFormatTypeDescriptor_TTS; struct usb_Audio_st_endpoint_descriptor SpkStandardEndpointDescriptor_TTS; struct usb_Audio_cs_ASendpoint_descriptor SpkEndpointDescriptor_TTS; -#endif +#ifdef HID_DEVICE // Report descriptor //------------------------------------------------------------------------- uint8_t rep[SIZE_OF_REPORT]; +#endif }; Modified: firmware/fuxusb/trunk/src/usb_enum.c =================================================================== --- firmware/fuxusb/trunk/src/usb_enum.c 2008-05-16 10:25:56 UTC (rev 1165) +++ firmware/fuxusb/trunk/src/usb_enum.c 2008-05-16 13:08:02 UTC (rev 1166) @@ -340,6 +340,7 @@ #endif break; } +#ifdef HID_DEVICE case REPORT: { data_to_transfer = SIZE_OF_REPORT; @@ -352,6 +353,7 @@ pbuffer = &(usb_configuration.HIDStandardDescriptor.bLength); break; } +#endif case STRING: { #ifdef USB_ENUM_DEBUG |
From: Paul_R <c2m...@c2...> - 2008-05-16 10:27:07
|
Author: Paul_R Date: 2008-05-16 12:25:56 +0200 (Fri, 16 May 2008) New Revision: 1165 Added: firmware/fuxusb/trunk/src/doc/ firmware/fuxusb/trunk/src/doc/Doxyfile firmware/fuxusb/trunk/src/doc/builddoc.sh Modified: firmware/fuxusb/trunk/src/fifo_mic.c firmware/fuxusb/trunk/src/fifo_mic.h firmware/fuxusb/trunk/src/fifo_spk.c firmware/fuxusb/trunk/src/fifo_spk.h firmware/fuxusb/trunk/src/fifo_stt.c firmware/fuxusb/trunk/src/fifo_stt.h firmware/fuxusb/trunk/src/global.h firmware/fuxusb/trunk/src/main.c Log: * Added doxygen comments on fifos modules and main.c * Added the doxyfile. To generate doc, goto src/doc and run builddoc.sh Added: firmware/fuxusb/trunk/src/doc/Doxyfile =================================================================== --- firmware/fuxusb/trunk/src/doc/Doxyfile (rev 0) +++ firmware/fuxusb/trunk/src/doc/Doxyfile 2008-05-16 10:25:56 UTC (rev 1165) @@ -0,0 +1,1283 @@ +# Doxyfile 1.5.2 - Doxygen configuration file for TUXCORE +# +# TUXCORE - Firmware for the 'core' CPU of tuxdroid +# Copyright (C) 2007 C2ME S.A. <tux...@c2...> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# $Id: Doxyfile 667 2007-11-08 15:45:41Z jaguarondi $ +ctions +void main (void) + The mainloop is divided in three major tasks : + + * USB task which parse and control the USB bus. + + +Detailed Description +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file that +# follow. The default is UTF-8 which is also the encoding used for all text before +# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into +# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of +# possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = fuxusb +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = $(VERSION) + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = doc + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, +# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, +# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, +# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = YES + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like the Qt-style comments (thus requiring an +# explicit @brief command for a brief description. + +JAVADOC_AUTOBRIEF = YES + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = YES + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = YES + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for Java. +# For instance, namespaces will be presented as packages, qualified scopes +# will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to +# include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = NO + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from the +# version control system). Doxygen will invoke the program by executing (via +# popen()) the command <command> <input-file>, where <command> is the value of +# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = + +# This tag can be used to specify the character encoding of the source files that +# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default +# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. +# See http://www.gnu.org/software/libiconv for the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = */.svn/* */dep/* + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the output. +# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, +# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = doc + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command <filter> <input-file>, where <filter> +# is the value of the INPUT_FILTER tag, and <input-file> is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentstion. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = __DOXYGEN__ + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to +# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to +# specify the directory where the mscgen tool resides. If left empty the tool is assumed to +# be found in the default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will +# generate a caller dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable caller graphs for selected +# functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen will always +# show the root nodes and its direct children regardless of this setting. + +DOT_GRAPH_MAX_NODES = 50 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, which results in a white background. +# Warning: Depending on the platform used, enabling this option may lead to +# badly anti-aliased labels on the edges of a graph (i.e. they become hard to +# read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO Added: firmware/fuxusb/trunk/src/doc/builddoc.sh =================================================================== --- firmware/fuxusb/trunk/src/doc/builddoc.sh (rev 0) +++ firmware/fuxusb/trunk/src/doc/builddoc.sh 2008-05-16 10:25:56 UTC (rev 1165) @@ -0,0 +1,30 @@ +#!/bin/bash +# +# This script builds the Doxygen documentation +# +# Written by David Bourgeois <da...@ja...> +# +# $Id$ + +# This script should be started from the base folder, not the doc folder. +if [ $(basename $PWD) == "doc" ] +then + cd .. +fi + +# Get version number from version.h. +if [ -f version.h ] +then + VERSION_MAJ=$(sed -n "s/\#define VER_MAJOR *//p" version.h) + VERSION_MIN=$(sed -n "s/\#define VER_MINOR *//p" version.h) + VERSION_UP=$(sed -n "s/\#define VER_UPDATE *//p" version.h) +else + echo "Error: version.h doesn't exist, aborting." + exit 1 +fi + +export VERSION="Version $VERSION_MAJ.$VERSION_MIN.$VERSION_UP" + +echo "Generating documentation for fuxusb" +echo $VERSION +doxygen doc/Doxyfile Property changes on: firmware/fuxusb/trunk/src/doc/builddoc.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + text/x-sh Name: svn:keywords + Id Name: svn:eol-style + native Modified: firmware/fuxusb/trunk/src/fifo_mic.c =================================================================== --- firmware/fuxusb/trunk/src/fifo_mic.c 2008-05-16 08:48:51 UTC (rev 1164) +++ firmware/fuxusb/trunk/src/fifo_mic.c 2008-05-16 10:25:56 UTC (rev 1165) @@ -17,14 +17,14 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id:$ */ +/* $Id$ */ + /** \file fifo_mic.c - \brief Microphone FIFO - \ingroup fifo + \brief Functions library for the microphone fifo. + \ingroup fifo_mic */ - #include "config.h" #include "global.h" #include "fifo_mic.h" @@ -42,8 +42,9 @@ bit Fifoready_MIC = 0; /** - * \brief Init the microphone FIFO. * This function reset all indexes and the byte counter. + * \ingroup fifo_mic + * \ingroup fifo_mic */ void FIFO_MIC_init (void) { @@ -60,6 +61,7 @@ * This function is made to save time when N bytes must be pushed on the fifo. * It's a specific function which directly read the USB EP fifo. So, the EP must * be previously selected. + * \ingroup fifo_mic */ void FIFO_MIC_put_n(uint8_t n) { @@ -67,7 +69,7 @@ i = n; do { - FifoOut_MIC_cmpt++; + FifoOut_MIC_cmpt++; if (FifoOut_MIC_cmpt >= FIFO_MIC_READY_VALUE) Fifoready_MIC = 1; if (FifoOut_MIC_cmpt == FIFO_MIC_OVERLOAD) @@ -88,6 +90,7 @@ /** * \brief Push one byte in the microphone FIFO. * \param Data : The data to push. + * \ingroup fifo_mic */ uint8_t FIFO_MIC_get (void) { Modified: firmware/fuxusb/trunk/src/fifo_mic.h =================================================================== --- firmware/fuxusb/trunk/src/fifo_mic.h 2008-05-16 08:48:51 UTC (rev 1164) +++ firmware/fuxusb/trunk/src/fifo_mic.h 2008-05-16 10:25:56 UTC (rev 1165) @@ -17,18 +17,25 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id:$ */ +/* $Id$ */ -/** \file fifo_mic.h - \brief Microphone FIFO hearder - \ingroup fifo -*/ -/** \defgroup fifo FIFOs +/** + * \defgroup fifo_mic Microphone FIFO. + \brief FIFO_MIC used for the microphone data, received from the RF and sent + to the computer. + + This FIFO are specific for this application and the context. + It's optimized for speed. It's not circular, and the access to the + buffer are direct. - Theses FIFOs are specific for the TuxDroid usb dongle. + \ingroup fuxusb */ +/** \file fifo_mic.h + \brief Publics declaration for the microphone's fifo module. + \ingroup fifo_mic +*/ #ifndef _FIFO_MIC_H_ #define _FIFO_MIC_H_ Modified: firmware/fuxusb/trunk/src/fifo_spk.c =================================================================== --- firmware/fuxusb/trunk/src/fifo_spk.c 2008-05-16 08:48:51 UTC (rev 1164) +++ firmware/fuxusb/trunk/src/fifo_spk.c 2008-05-16 10:25:56 UTC (rev 1165) @@ -20,8 +20,9 @@ /* $Id$ */ /** \file fifo_spk.c - \brief Speaker FIFO - \ingroup fifo + \brief Function library for the speaker. + This fifo is specific for this application and context. + \ingroup fifo_spk */ #include "config.h" @@ -45,6 +46,7 @@ /** * \brief Init the Speaker FIFO. * This function reset all indexes and the byte counter. + * \ingroup fifo_spk */ void FIFO_SPK_init (void) { @@ -60,6 +62,7 @@ * This function is made to save time when N bytes must be pushed on the fifo. * It's a specific function which directly read the USB EP fifo. So, the EP must * be previously selected. + * \ingroup fifo_spk */ void FIFO_SPK_put_n (uint8_t const n) { @@ -92,6 +95,7 @@ /** * \brief Pop one byte on the Speaker FIFO. * \return The popped byte. + * \ingroup fifo_spk */ uint8_t FIFO_SPK_get(void) { Modified: firmware/fuxusb/trunk/src/fifo_spk.h =================================================================== --- firmware/fuxusb/trunk/src/fifo_spk.h 2008-05-16 08:48:51 UTC (rev 1164) +++ firmware/fuxusb/trunk/src/fifo_spk.h 2008-05-16 10:25:56 UTC (rev 1165) @@ -17,19 +17,25 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ... [truncated message content] |
From: Paul_R <c2m...@c2...> - 2008-05-16 08:48:46
|
Author: Paul_R Date: 2008-05-16 10:48:51 +0200 (Fri, 16 May 2008) New Revision: 1164 Modified: firmware/fuxusb/trunk/src/usb_commands.c firmware/fuxusb/trunk/src/usb_misc.c firmware/fuxusb/trunk/src/usb_task.c Log: * Added comments in usb_misc.c * Typo on usb_task.c * Reorganized functions in usb_commands.c Modified: firmware/fuxusb/trunk/src/usb_commands.c =================================================================== --- firmware/fuxusb/trunk/src/usb_commands.c 2008-05-16 08:12:21 UTC (rev 1163) +++ firmware/fuxusb/trunk/src/usb_commands.c 2008-05-16 08:48:51 UTC (rev 1164) @@ -81,7 +81,73 @@ } } +/** + *\brief Fill the USB EP Fifo with statuses. + * This function prepare the USB EP Fifo with the lasts statuses received. + */ +void prepare_status(void) +{ + uint8_t data i; + + + if((status_requested) && (CMD_IN_Bank_Nb < 2)) + { + Usb_select_ep(EP_CMD_IN); + + /* Write header */ + Usb_write_byte(0); + Usb_write_byte(RF_OFFLINE ? 0 : 1); + Usb_write_byte(RF_Status); + Usb_write_byte(FifoIn_STT_Idx ? (FifoIn_STT_Idx / 4) : 0); + + /* Write statuses */ + for(i=0;i<FifoIn_STT_Idx;i++) + { + Usb_write_byte(FIFO_STT_get()); + } + /* And finish with 0 to completly fill the EP fifo */ + for(i=FifoIn_STT_Idx;i<60;i++) + { + Usb_write_byte(0); + } + + /* Clear the status fifo */ + FIFO_STT_flush(); + /* Increase the bank number */ + CMD_IN_Bank_Nb ++; + /* Put the statuses on the USB bus */ + send_status(); + /* Clear flags */ + RF_Status = 0; + status_requested = False; + } +} + /* + * Acknowledge or not a bootloader command. + * \param ack Send an ACK if ack is set, NACK otherwise + * \param p1, p2, p3: optional paramaters + */ +void bl_acknowledge(uint8_t ack, uint8_t p1, uint8_t p2, uint8_t p3) +{ + Usb_select_ep(EP_CMD_IN); + +#ifdef BL_EP_DEBUG + printf("SEND ACK \n"); +#endif + + Usb_write_byte(BOOTLOADER_CMD); + Usb_write_byte(ack ? B_ACK : B_NACK); + Usb_write_byte(p1); + Usb_write_byte(p2); + Usb_write_byte(p3); + + CMD_IN_Bank_Nb ++; + + send_status(); +} + +/* * \brief Parse commands for dongle. */ static void dongle_cmd_parser(void) @@ -96,15 +162,12 @@ case STATUS_REQUEST: status_requested = True; break; - case RF_RESET: reset_rf(); break; - case USB_RESET: reset_dongle(); break; - case ISP_MODE: jump_bootloader(); break; @@ -151,72 +214,6 @@ } /** - *\brief Fill the USB EP Fifo with statuses. - * This function prepare the USB EP Fifo with the lasts statuses received. - */ -void prepare_status(void) -{ - uint8_t data i; - - - if((status_requested) && (CMD_IN_Bank_Nb < 2)) - { - Usb_select_ep(EP_CMD_IN); - - /* Write header */ - Usb_write_byte(0); - Usb_write_byte(RF_OFFLINE ? 0 : 1); - Usb_write_byte(RF_Status); - Usb_write_byte(FifoIn_STT_Idx ? (FifoIn_STT_Idx / 4) : 0); - - /* Write statuses */ - for(i=0;i<FifoIn_STT_Idx;i++) - { - Usb_write_byte(FIFO_STT_get()); - } - /* And finish with 0 to completly fill the EP fifo */ - for(i=FifoIn_STT_Idx;i<60;i++) - { - Usb_write_byte(0); - } - - /* Clear the status fifo */ - FIFO_STT_flush(); - /* Increase the bank number */ - CMD_IN_Bank_Nb ++; - /* Put the statuses on the USB bus */ - send_status(); - /* Clear flags */ - RF_Status = 0; - status_requested = False; - } -} - -/* - * Acknowledge or not a bootloader command. - * \param ack Send an ACK if ack is set, NACK otherwise - * \param p1, p2, p3: optional paramaters - */ -#define B_ACK 0 -#define B_NACK 1 -void bl_acknowledge(uint8_t ack, uint8_t p1, uint8_t p2, uint8_t p3) -{ - Usb_select_ep(EP_CMD_IN); -#ifdef BL_EP_DEBUG - printf("SEND ACK \n"); -#endif - Usb_write_byte(BOOTLOADER_CMD); - Usb_write_byte(ack ? B_ACK : B_NACK); - Usb_write_byte(p1); - Usb_write_byte(p2); - Usb_write_byte(p3); - - CMD_IN_Bank_Nb ++; - - send_status(); -} - -/** *\brief Perform a complete reset. */ static void reset_dongle(void) Modified: firmware/fuxusb/trunk/src/usb_misc.c =================================================================== --- firmware/fuxusb/trunk/src/usb_misc.c 2008-05-16 08:12:21 UTC (rev 1163) +++ firmware/fuxusb/trunk/src/usb_misc.c 2008-05-16 08:48:51 UTC (rev 1164) @@ -27,7 +27,10 @@ #include "rf.h" #include "lib_mcu\usb\usb_drv.h" - +/** + * \brief Suspend the USB bus. + * This function suspend the bus and keep the rf board on reset state. + */ void suspend_usb(void) { Usb_clear_suspend(); @@ -35,6 +38,10 @@ rf_reset_signal = 0; } +/** + * \brief Resume the USB bus. + * This function resume the bus afetr a suspend state. + */ void resume_usb(void) { Usb_clear_suspend_clock(); @@ -43,6 +50,10 @@ Usb_clear_sof(); } +/** + * \brief Reset the bus. + * This function reset the usb bus. + */ void reset_usb(void) { Usb_clear_reset(); @@ -50,11 +61,15 @@ FIFO_STT_init(); } +/** + * \brief reattach USB. + * This function simulate a disconnexion/connexion of the USB device. + * This is used when the device has to be re-enumerated (ISP mode for example). + */ void reattach_usb(void) { long tc; - /* Detach and attach usb */ tc=10000; Usb_detach(); while(tc) tc --; Modified: firmware/fuxusb/trunk/src/usb_task.c =================================================================== --- firmware/fuxusb/trunk/src/usb_task.c 2008-05-16 08:12:21 UTC (rev 1163) +++ firmware/fuxusb/trunk/src/usb_task.c 2008-05-16 08:48:51 UTC (rev 1164) @@ -31,7 +31,6 @@ void usb_task_init(void) { - uint16_t timer=10000; configure_usb_clock(); Usb_enable(); @@ -59,11 +58,15 @@ else if (Usb_suspend()) suspend_usb(); + /* + * When the SOF is detected, manage the LEDs. + */ if (Usb_sof()) { Usb_clear_sof(); led_behavior(); + /* This counter is used to temporise the i2c task. */ if (i2c_wait_counter) i2c_wait_counter--; } @@ -71,6 +74,7 @@ * Load the microphone EP if it's not already loaded and if the micro * fifo is ready. */ + fill_mic_ep(); /* * Prepare the statuses when a request has been received |
From: Paul_R <c2m...@c2...> - 2008-05-16 08:12:18
|
Author: Paul_R Date: 2008-05-16 10:12:21 +0200 (Fri, 16 May 2008) New Revision: 1163 Modified: firmware/fuxusb/trunk/src/fifo_stt.h Log: * Removed an include in fifo_stt.h Modified: firmware/fuxusb/trunk/src/fifo_stt.h =================================================================== --- firmware/fuxusb/trunk/src/fifo_stt.h 2008-05-16 08:11:55 UTC (rev 1162) +++ firmware/fuxusb/trunk/src/fifo_stt.h 2008-05-16 08:12:21 UTC (rev 1163) @@ -22,7 +22,6 @@ #ifndef _FIFO_STT_H_ #define _FIFO_STT_H_ -#include "config.h" extern data uint8_t FifoIn_STT_Idx; |
From: Paul_R <c2m...@c2...> - 2008-05-16 08:11:56
|
Author: Paul_R Date: 2008-05-16 10:11:55 +0200 (Fri, 16 May 2008) New Revision: 1162 Modified: firmware/fuxusb/trunk/src/usb_commands.c Log: * Moved the versionning from the tux commands to dongle commands. The commands for Tux don't need to be parsed anymore. Modified: firmware/fuxusb/trunk/src/usb_commands.c =================================================================== --- firmware/fuxusb/trunk/src/usb_commands.c 2008-05-16 08:04:34 UTC (rev 1161) +++ firmware/fuxusb/trunk/src/usb_commands.c 2008-05-16 08:11:55 UTC (rev 1162) @@ -34,12 +34,9 @@ /* Statics defs */ static void dongle_cmd_parser(void); -static void tux_cmd_parser(void); static void jump_bootloader(void); static void reset_dongle(void); - - /** * \brief Parse the received command */ @@ -71,7 +68,10 @@ /* Commands for Tux */ case TUX_CMD_HDR: new_cmd_enabled = False; - tux_cmd_parser(); + new_command_received = True; + /* Transfert commands from command_received buffer to rf_commands. */ + for(i=0;i < 4;i++) + rf_commands[i] = command_received[i]; break; /* Bootloader commands */ case BOOTLOADER_CMD_HDR: @@ -111,7 +111,7 @@ } } /* TTS commands */ - if (command_received[0] == TTS_CMD) + else if (command_received[0] == TTS_CMD) { switch (command_received[1]) { @@ -124,6 +124,30 @@ break; } } + /* Dongle version command */ + else if (command_received[0] == INFO_FUXUSB_CMD) + { + FIFO_STT_flush(); + /* Version */ + FIFO_STT_put(info_version.version_cmd); + FIFO_STT_put(info_version.cpu_ver_maj); + FIFO_STT_put(info_version.ver_minor); + FIFO_STT_put(info_version.ver_update); + + /* Revision */ + FIFO_STT_put(info_revision.revision_cmd); + FIFO_STT_put((info_revision.revision&0xFF00)>>8); + FIFO_STT_put((info_revision.revision&0x00FF)); + FIFO_STT_put(info_revision.release_type); + + /* Author */ + FIFO_STT_put(info_author.author_cmd); + FIFO_STT_put((info_author.author_id&0xFF00)>>8); + FIFO_STT_put((info_author.author_id&0x00FF)); + FIFO_STT_put(info_author.variation); + + status_requested = True; + } } /** @@ -192,49 +216,7 @@ send_status(); } - /** - * Parse generic tux commands and process those addressed to the dongle. - */ -static void tux_cmd_parser(void) -{ - uint8_t i = 0; - - new_command_received = True; - /* Transfert commands from command_received buffer to rf_commands. */ - for(i=0;i < 4;i++) - rf_commands[i] = command_received[i]; -#ifdef VERSION - // XXX This routine should be moved from here to the dongle_cmd_parser. - if (rf_commands[0] == INFO_FUXUSB_CMD) - { - /* Version */ - FIFO_STT_put(info_version.version_cmd); - FIFO_STT_put(info_version.cpu_ver_maj); - FIFO_STT_put(info_version.ver_minor); - FIFO_STT_put(info_version.ver_update); - - /* Revision */ - FIFO_STT_put(info_revision.revision_cmd); - FIFO_STT_put((info_revision.revision&0xFF00)>>8); - FIFO_STT_put((info_revision.revision&0x00FF)); - FIFO_STT_put(info_revision.release_type); - - /* Author */ - FIFO_STT_put(info_author.author_cmd); - FIFO_STT_put((info_author.author_id&0xFF00)>>8); - FIFO_STT_put((info_author.author_id&0x00FF)); - FIFO_STT_put(info_author.variation); - - /* This command is not for the RF. Reset the flag */ - new_command_received = False; - new_cmd_enabled = True; - } - // End XXX. -#endif -} - -/** *\brief Perform a complete reset. */ static void reset_dongle(void) |
From: Paul_R <c2m...@c2...> - 2008-05-16 08:04:42
|
Author: Paul_R Date: 2008-05-16 10:04:34 +0200 (Fri, 16 May 2008) New Revision: 1161 Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_firmware.c Log: * Changed the FUX status request command. The prev. command (0 6 0 0 0) has been replaced by (1 6 0 0 0). The reason is a simplification of the dongle. Normally, commands for Tux are sent directly on the SPI bus. Because of this command, I was obliged to parse all the commands. Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_firmware.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_firmware.c 2008-05-16 06:53:22 UTC (rev 1160) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_firmware.c 2008-05-16 08:04:34 UTC (rev 1161) @@ -343,8 +343,14 @@ cpu_id_to_name(cpu_id)); #endif - ret = tux_usb_send_to_tux(data); - + if (cpu_id == FUXUSB_CPU_NUM) + { + ret = tux_usb_send_to_dongle(data); + } + else + { + ret = tux_usb_send_to_tux(data); + } if (ret) { return 1; |
From: Paul_R <c2m...@c2...> - 2008-05-16 06:53:22
|
Author: Paul_R Date: 2008-05-16 08:53:22 +0200 (Fri, 16 May 2008) New Revision: 1160 Modified: firmware/fuxusb/trunk/src/usb_enum.c firmware/fuxusb/trunk/src/usb_enum.h Log: * Added defines for bmRequestType. Modified: firmware/fuxusb/trunk/src/usb_enum.c =================================================================== --- firmware/fuxusb/trunk/src/usb_enum.c 2008-05-15 16:39:37 UTC (rev 1159) +++ firmware/fuxusb/trunk/src/usb_enum.c 2008-05-16 06:53:22 UTC (rev 1160) @@ -135,7 +135,7 @@ #endif /* Standard requests */ - if((bmRequestType & 0x60) == 0) + if((bmRequestType & CLASS_MK) == STANDARD) { #ifdef USB_ENUM_DEBUG printf(" Standard Request "); @@ -181,7 +181,7 @@ } } /* Audio specific requests */ - else if((bmRequestType & 0x60) == 0x20) + else if((bmRequestType & CLASS_MK) == AUDIO) { #ifdef USB_ENUM_DEBUG printf(" Class Request "); Modified: firmware/fuxusb/trunk/src/usb_enum.h =================================================================== --- firmware/fuxusb/trunk/src/usb_enum.h 2008-05-15 16:39:37 UTC (rev 1159) +++ firmware/fuxusb/trunk/src/usb_enum.h 2008-05-16 06:53:22 UTC (rev 1160) @@ -67,7 +67,10 @@ #define INTERFACE_TYPE 0x01 #define ENDPOINT_TYPE 0x02 - +/* MASKS */ +#define CLASS_MK 0x60 +#define STANDARD 0x00 +#define AUDIO 0x20 /*_____ D E C L A R A T I O N ______________________________________________*/ |
From: remi <c2m...@c2...> - 2008-05-15 16:40:01
|
Author: remi Date: 2008-05-15 18:39:37 +0200 (Thu, 15 May 2008) New Revision: 1159 Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_types.h Log: * Fixed a bug in "tux_cmd_parser_parse_file". * Updated the functions which parse the macro in order to avoid the premature stop of a macro when a bad command is detected (the macros can contain OSL and DRIVER commands) Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.c 2008-05-15 15:10:29 UTC (rev 1158) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.c 2008-05-15 16:39:37 UTC (rev 1159) @@ -1179,7 +1179,7 @@ { const char lex_ret[] = "\n"; char *line_tmp; - char macro[CMDSIZE]; + char macro[MACROSIZE]; TuxDrvError ret = E_TUXDRV_NOERROR; #ifdef USE_MUTEX @@ -1196,7 +1196,10 @@ ret = parse_line(line_tmp); if (ret != E_TUXDRV_NOERROR) { - return(ret); + if (ret != E_TUXDRV_INVALIDCOMMAND) + { + return(ret); + } } while ((line_tmp = strtok(NULL, lex_ret)) != NULL) @@ -1204,7 +1207,10 @@ ret = parse_line(line_tmp); if (ret != E_TUXDRV_NOERROR) { - break; + if (ret != E_TUXDRV_INVALIDCOMMAND) + { + return(ret); + } } } } @@ -1238,7 +1244,10 @@ ret = parse_line(line); if (ret != E_TUXDRV_NOERROR) { - break; + if (ret != E_TUXDRV_INVALIDCOMMAND) + { + return(ret); + } } } fclose(macro_file); Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_types.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_types.h 2008-05-15 15:10:29 UTC (rev 1158) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_types.h 2008-05-15 16:39:37 UTC (rev 1159) @@ -28,6 +28,7 @@ typedef unsigned char raw_frame[5]; #define CMDSIZE 1024 +#define MACROSIZE 16384 /* command groups */ typedef enum { |
From: Paul_R <c2m...@c2...> - 2008-05-15 15:10:32
|
Author: Paul_R Date: 2008-05-15 17:10:29 +0200 (Thu, 15 May 2008) New Revision: 1158 Modified: firmware/fuxusb/trunk/fuxusb.Opt firmware/fuxusb/trunk/src/usb_enum.c Log: * Added comments on usb_enum.c * Grouped the functions by requests type (standard, audio and hid specifics). Modified: firmware/fuxusb/trunk/fuxusb.Opt =================================================================== (Binary files differ) Modified: firmware/fuxusb/trunk/src/usb_enum.c =================================================================== --- firmware/fuxusb/trunk/src/usb_enum.c 2008-05-15 14:19:14 UTC (rev 1157) +++ firmware/fuxusb/trunk/src/usb_enum.c 2008-05-15 15:10:29 UTC (rev 1158) @@ -27,6 +27,7 @@ #include "usb_ep.h" #include "spi_task.h" #include "fifo_stt.h" +#include "rf.h" #include "lib_mcu\usb\usb_drv.h" @@ -50,38 +51,30 @@ static void usb_get_interface(void); static void usb_set_interface(void); +/* AUDIO SPECIFIC REQUESTS */ static void usb_get_current(void); static void usb_get_min(void); static void usb_get_max(void); static void usb_get_res(void); - static void usb_set_current(void); static void usb_set_min(void); static void usb_set_max(void); static void usb_set_res(void); +/* HID SPECIFIC REQUESTS */ static void usb_hid_set_report(void); static void usb_hid_set_idle(void); static void usb_hid_get_idle(void); +/* MISC COMMANDS */ static void stall_request(void); static void send_zlp(void); -/*F************************************************************************** - * NAME: usb_var_init - *---------------------------------------------------------------------------- - * PARAMS: - * - * return: - *---------------------------------------------------------------------------- - * PURPOSE: - * This function initializes the USB controller and resets the endpoints FIFOs. - *---------------------------------------------------------------------------- - * EXAMPLE: - *---------------------------------------------------------------------------- - * NOTE: - *---------------------------------------------------------------------------- - * REQUIREMENTS: - *****************************************************************************/ + +/** + * \brief Init usb variables. + * This function init the endpoints status, clear the configuration flag and + * clear the Bank variables. + */ void usb_var_init (void) { endpoint_status[1] = 0x00; @@ -94,89 +87,45 @@ CMD_OUT_Bank_Nb = 0; } - -/*F************************************************************************** - * NAME: usb_ep_init - *---------------------------------------------------------------------------- - * PARAMS: - * - * return: - *---------------------------------------------------------------------------- - * PURPOSE: - * This function configures the endpoints. - *---------------------------------------------------------------------------- - * EXAMPLE: - *---------------------------------------------------------------------------- - * NOTE: - *---------------------------------------------------------------------------- - * REQUIREMENTS: - *****************************************************************************/ +/** + * \brief Init endpoints. + * Configure the endpoints and reset them. After this functions, the endpoints + * are configured and ready to be used. + */ static void usb_ep_init (void) { usb_configure_endpoint(EP_AUDIO_IN, ISOCHRONOUS_IN); usb_reset_endpoint(EP_AUDIO_IN); + usb_configure_endpoint(EP_AUDIO_OUT, ISOCHRONOUS_OUT); usb_reset_endpoint(EP_AUDIO_OUT); + usb_configure_endpoint(EP_AUDIO_OUT_TTS, ISOCHRONOUS_OUT); usb_reset_endpoint(EP_AUDIO_OUT_TTS); + usb_configure_endpoint(EP_CMD_IN, INTERRUPT_IN); usb_reset_endpoint(EP_CMD_IN); + usb_configure_endpoint(EP_CMD_OUT, INTERRUPT_OUT); usb_reset_endpoint(EP_CMD_OUT); } - - -/*F**************************************************************************** - * NAME: usb_enumeration_process - *---------------------------------------------------------------------------- - * PARAMS: - * - * return: - *---------------------------------------------------------------------------- - * PURPOSE: - * This function manages the enumeration process - *---------------------------------------------------------------------------- - * EXAMPLE: - *---------------------------------------------------------------------------- - * NOTE: - *---------------------------------------------------------------------------- - * REQUIREMENTS: - *****************************************************************************/ +/** + * \brief Enumeration process - main function. + * This is the only one public function for the enumeration process. + * The CONTROL EP is selected, and the request can be parsed. + */ void usb_enumeration_process (void) { Usb_select_ep(EP_CONTROL); usb_read_request(); } - -/*F*************************************************************************** - * NAME: usb_read_request - *---------------------------------------------------------------------------- - * PARAMS: - * - * return: - *---------------------------------------------------------------------------- - * PURPOSE: - * This function reads the SETUP request sent to the default control endpoint - * and the appropriate function. When exiting of the usb_read_request - * function, the device is ready to manage the next request. - *---------------------------------------------------------------------------- - * EXAMPLE: - *---------------------------------------------------------------------------- - * NOTE: list of supported requests: - * GET_DESCRIPTOR - * GET_CONFIGURATION - * SET_ADDRESS - * SET_CONFIGURATION or SET_REPORT - * CLEAR_FEATURE - * SET_FEATURE - * GET_STATUS - * GET_MAX_LUN - * MASS_STORAGE_RESET - *---------------------------------------------------------------------------- - * REQUIREMENTS: - *****************************************************************************/ +/** + * \brief Read the USB request. + * This function parse the bmRequestType and bRequest. It determine the request + * type, and call the appropriate function. + */ static void usb_read_request (void) { bmRequestType = Usb_read_byte(); /* read bmRequestType */ @@ -185,9 +134,7 @@ printf("RQ:: bmRequestType %BX bRequest %BX ",bmRequestType,bRequest); #endif - //---------------------------------------------------------------- - // Standard Requests - //---------------------------------------------------------------- + /* Standard requests */ if((bmRequestType & 0x60) == 0) { #ifdef USB_ENUM_DEBUG @@ -212,12 +159,11 @@ if (bmRequestType == 0x81) { usb_get_interface(); } else { usb_hid_set_idle(); } break; - case SET_INTERFACE: usb_set_interface(); break; - /* HID Specific request */ + /* HID Specific requests */ case HID_GET_IDLE: usb_hid_get_idle(); break; @@ -234,32 +180,26 @@ break; } } - //---------------------------------------------------------------- - // Class Requests - //---------------------------------------------------------------- + /* Audio specific requests */ else if((bmRequestType & 0x60) == 0x20) { #ifdef USB_ENUM_DEBUG printf(" Class Request "); #endif - switch (bRequest) /* test the bRequest value */ + switch (bRequest) { case GET_CURRENT: usb_get_current(); break; - case GET_MIN: usb_get_min(); break; - case GET_MAX: usb_get_max(); break; - case GET_RES: usb_get_res(); break; - default: #ifdef USB_ENUM_DEBUG printf("Unknown Request "); @@ -268,7 +208,6 @@ stall_request(); break; } - } else { @@ -278,130 +217,68 @@ Usb_clear_rx_setup(); stall_request(); } - #ifdef USB_ENUM_DEBUG printf("\n"); #endif - Usb_clear_DIR(); } - -/*F************************************************************************** - * NAME: usb_set_address - *---------------------------------------------------------------------------- - * PARAMS: - * - * return: - *---------------------------------------------------------------------------- - * PURPOSE: - * This function manages the SET_ADDRESS request. The new address is stored - * in the USBADDR register - *---------------------------------------------------------------------------- - * EXAMPLE: - *---------------------------------------------------------------------------- - * NOTE: - *---------------------------------------------------------------------------- - * REQUIREMENTS: - *****************************************************************************/ +/** \brief Set the address. + * When a set adress request has been received, the adress must be stored in the + * USBADDR register. + */ static void usb_set_address (void) { - uint8_t add; + uint8_t address; - add = Usb_read_byte(); /* store the LSB of wValue = address */ + address = Usb_read_byte(); Usb_clear_rx_setup(); Usb_set_FADDEN(); send_zlp(); - Usb_configure_address(add); + Usb_configure_address(address); #ifdef USB_ENUM_DEBUG - printf("SET_ADDRESSE %BX",add); + printf("SET_ADDRESSE %BX",address); #endif } - -/*F*************************************************************************** - * NAME: usb_set_configuration - *---------------------------------------------------------------------------- - * PARAMS: - * - * return: - *---------------------------------------------------------------------------- - * PURPOSE: - * This function manages the SET_CONFIGURATION request. - *---------------------------------------------------------------------------- - * EXAMPLE: - *---------------------------------------------------------------------------- - * NOTE: - *---------------------------------------------------------------------------- - * REQUIREMENTS: - *****************************************************************************/ +/** + * \brief Set configuration parser. + * When a SET_CONFIGURATION request has been received, the request is parsed. + * This allow to execute some specifics tasks depending of the config. + */ static void usb_set_configuration (void) { - // R modif - long tc; - // uint8_t configuration_number; - configuration_number = Usb_read_byte(); /* read the conf. num. in wValue */ + + configuration_number = Usb_read_byte(); Usb_clear_DIR(); Usb_clear_rx_setup(); if (configuration_number <= CONF_NB) { -// XXX usb_configuration_nb = configuration_number; if (configuration_number == 1) { -// uint16_t i; - // XXX - rf_reset_signal = 0; - // R modif - tc=32000; - while(tc) - tc--; - - rf_reset_signal = 1; - // Fin r modif - //Led_0_on(); -// XXX + reset_rf(); spi_task_init(); -// FIFO_MIC_init(); // Modif de test -// FIFO_SPK_init(); // Modif de test FIFO_STT_init(); -// spi_task_on_Flag = 1; } + send_zlp(); + usb_ep_init(); /* endpoints configuration */ + Usb_set_CONFG(); +#ifdef USB_ENUM_DEBUG + printf("SET_CONFIG configuration_number : %BX",configuration_number); +#endif } else - { stall_request(); - return; - } - - send_zlp(); - usb_ep_init(); /* endpoints configuration */ - Usb_set_CONFG(); - -#ifdef USB_ENUM_DEBUG - printf("SET_CONFIG configuration_number : %BX",configuration_number); -#endif } - -/*F*************************************************************************** - * NAME: usb_set_interface - *---------------------------------------------------------------------------- - * PARAMS: - * - * return: - *---------------------------------------------------------------------------- - * PURPOSE: - * This function manages the SET_INTERFACE request. - *---------------------------------------------------------------------------- - * EXAMPLE: - *---------------------------------------------------------------------------- - * NOTE: - *---------------------------------------------------------------------------- - * REQUIREMENTS: - *****************************************************************************/ +/** + * \brief Set interface. + * When a SET_INTERFACE request has been received, the request is parsed. + * This allows to execute specific code depending of the interface. + */ static void usb_set_interface (void) { uint8_t LAlternateSetting; @@ -410,10 +287,10 @@ uint8_t Linterface_number; uint8_t Hinterface_number; - LAlternateSetting = Usb_read_byte(); /* read the conf. num. in wValue */ - HAlternateSetting = Usb_read_byte(); /* read the conf. num. in wValue */ - Linterface_number = Usb_read_byte(); /* read the conf. num. in wValue */ - Hinterface_number = Usb_read_byte(); /* read the conf. num. in wValue */ + LAlternateSetting = Usb_read_byte(); + HAlternateSetting = Usb_read_byte(); + Linterface_number = Usb_read_byte(); + Hinterface_number = Usb_read_byte(); Usb_clear_DIR(); Usb_clear_rx_setup(); @@ -425,22 +302,9 @@ #endif } -/*F*************************************************************************** - * NAME: usb_get_descriptor - *---------------------------------------------------------------------------- - * PARAMS: - * - * return: - *---------------------------------------------------------------------------- - * PURPOSE: - * This function manages the GET_DESCRIPTOR request. - *---------------------------------------------------------------------------- - * EXAMPLE: - *---------------------------------------------------------------------------- - * NOTE: - *---------------------------------------------------------------------------- - * REQUIREMENTS: - *****************************************************************************/ +/** + * \brief Parse the GET_DESCRIPTOR request and send back the correct descriptor. + */ static void usb_get_descriptor (void) { uint16_t data_to_transfer; @@ -449,9 +313,10 @@ uint8_t string_type; zlp = False; /* no zero length packet */ - string_type = Usb_read_byte(); /* read LSB of wValue */ - descriptor_type = Usb_read_byte(); /* read MSB of wValue */ + string_type = Usb_read_byte(); + descriptor_type = Usb_read_byte(); + #ifdef USB_ENUM_DEBUG printf("GET_DESCRIPTOR %BX %BX ",descriptor_type,string_type); #endif @@ -466,7 +331,6 @@ #endif break; } - case CONFIGURATION: { data_to_transfer = sizeof (usb_configuration); @@ -476,14 +340,12 @@ #endif break; } - case REPORT: { data_to_transfer = SIZE_OF_REPORT; pbuffer = &(usb_configuration.rep[0]); break; } - case HID: { data_to_transfer = sizeof(usb_configuration.HIDStandardDescriptor); @@ -497,7 +359,6 @@ #endif switch (string_type) { - case LANG_ID: { data_to_transfer = sizeof (usb_language); @@ -507,7 +368,6 @@ #endif break; } - case MAN_STRING_INDEX: { data_to_transfer = sizeof (usb_manufacturer); @@ -600,8 +460,10 @@ ACC = Usb_read_byte(); /* don't care of wIndex field */ ACC = Usb_read_byte(); + ((uint8_t *)&wLength)[1] = Usb_read_byte(); /* read wLength */ ((uint8_t *)&wLength)[0] = Usb_read_byte(); + if (wLength > data_to_transfer) { if ((data_to_transfer % EP_CONTROL_LENGTH) == 0) { zlp = True; } @@ -628,7 +490,6 @@ #ifdef USB_ENUM_DEBUG printf("2"); #endif - return; } } @@ -644,10 +505,8 @@ #ifdef USB_ENUM_DEBUG printf("3"); #endif - return; } - if (zlp == True) { usb_send_ep0_packet(pbuffer, 0); @@ -660,7 +519,6 @@ #ifdef USB_ENUM_DEBUG printf("4"); #endif - return; } @@ -671,7 +529,6 @@ #ifdef USB_ENUM_DEBUG printf("5"); #endif - return; } @@ -686,22 +543,187 @@ } -/*F************************************************************************** - * NAME: usb_get_current - *---------------------------------------------------------------------------- - * PARAMS: - * - * return: - *---------------------------------------------------------------------------- - * PURPOSE: - * - *---------------------------------------------------------------------------- - * EXAMPLE: - *---------------------------------------------------------------------------- - * NOTE: - *---------------------------------------------------------------------------- - * REQUIREMENTS: - *****************************************************************************/ +/** + * \brief Get configuration number. + * The host want to know what's the current configuration number. + */ +static void usb_get_configuration (void) +{ + Usb_clear_rx_setup(); + Usb_set_DIR(); + + Usb_write_byte(usb_configuration_nb); + + Usb_set_tx_ready(); + while (!(Usb_tx_complete())); + Usb_clear_tx_complete(); + while (!(Usb_rx_complete())); + Usb_clear_rx(); + Usb_clear_DIR(); +} + +/** + * \brief Get interface request. + * The host want to know the status of a specific interface. + * This function isn't implemented. + */ +static void usb_get_interface (void) +{ + Usb_clear_rx_setup(); + Usb_set_DIR(); + stall_request(); + Usb_clear_DIR(); +} + + +/** + * \brief GET_STATUS request. + * The host want to know the status of the device. + * The request is parsed to send back the wanted information. + */ +static void usb_get_status (void) +{ + uint8_t wIndex; + + ACC = Usb_read_byte(); /* dummy read */ + ACC = Usb_read_byte(); /* dummy read */ + wIndex = Usb_read_byte(); + Usb_clear_rx_setup(); + Usb_set_DIR(); + switch(bmRequestType) + { + case REQUEST_DEVICE_STATUS: + Usb_write_byte(SELF_POWERED); + break; + + case REQUEST_INTERFACE_STATUS: + Usb_write_byte(0x00); + break; + + case REQUEST_ENDPOINT_STATUS: + wIndex = wIndex & MSK_EP_DIR; + Usb_write_byte(endpoint_status[wIndex]); + break; + } + Usb_write_byte(0x00); + + Usb_set_tx_ready(); + while ((!(Usb_tx_complete())) || (Usb_setup_received())); + Usb_clear_tx_complete(); + while ((!(Usb_rx_complete())) || (Usb_setup_received())); + Usb_clear_rx(); + Usb_clear_DIR(); +} + +/** + * \brief SET_FEATURE request. + * The host want to enable a feature on a device, inteface or EP. + */ +static void usb_set_feature (void) +{ + if (bmRequestType == ZERO_TYPE) + { + Usb_clear_rx_setup(); + stall_request(); + } + if (bmRequestType == INTERFACE_TYPE) + { + Usb_clear_rx_setup(); + stall_request(); + } + if (bmRequestType == ENDPOINT_TYPE) + { + if (Usb_read_byte() == 0x00) + { + ACC = Usb_read_byte(); /* dummy read */ + switch (Usb_read_byte()) /* check wIndex */ + { + case ENDPOINT_1: + { + Usb_select_ep(EP_IN); + Usb_set_stall_request(); + Usb_select_ep(EP_CONTROL); + endpoint_status[EP_IN] = 0x01; + Usb_clear_rx_setup(); + Usb_set_tx_ready(); + while (!(Usb_tx_complete())); + Usb_clear_tx_complete(); + break; + } + default: + { + Usb_clear_rx_setup(); + stall_request(); + break; + } + } + } + } +} + +/** + * \brief CLEAR_FEATURE request. + * The host want to disable a feature on a device, interface or EP. + */ +static void usb_clear_feature (void) +{ + if (bmRequestType == ZERO_TYPE) + { + Usb_clear_rx_setup(); + stall_request(); + } + if (bmRequestType == INTERFACE_TYPE) + { + Usb_clear_rx_setup(); + stall_request(); + } + if (bmRequestType == ENDPOINT_TYPE) + { + if (Usb_read_byte() == 0x00) + { + ACC = Usb_read_byte(); /* dummy read */ + switch (Usb_read_byte()) /* check wIndex */ + { + case ENDPOINT_1: + { + Usb_select_ep(EP_IN); + Usb_clear_stall_request(); + usb_reset_endpoint(EP_IN); + Usb_select_ep(EP_CONTROL); + endpoint_status[EP_IN] = 0x00; + Usb_clear_rx_setup(); + Usb_set_tx_ready(); + while (!(Usb_tx_complete())); + Usb_clear_tx_complete(); + break; + } + case ENDPOINT_0: + { + Usb_clear_rx_setup(); + Usb_set_tx_ready(); + while (!(Usb_tx_complete())); + Usb_clear_tx_complete(); + break; + } + default: + { + Usb_clear_rx_setup(); + stall_request(); + break; + } + } + } + } +} + +/* AUDIO SPECIFIC REQUESTS */ + +/** + * \brief Get current setting attribute. + * This is an audio specific request. The host requests the current setting + * value. + * This function isn't implemented. The current level is 0. + */ static void usb_get_current (void) { uint8_t LwValue = Usb_read_byte(); @@ -725,15 +747,12 @@ printf("GET CURRENT %BX %BX %BX %BX Answer",LwValue,HwValue,\ LwIndex,HwIndex); #endif - - -#ifdef USB_ENUM_DEBUG - printf("GET CURRENT %BX %BX %BX %BX STALL",LwValue,HwValue,\ - LwIndex,HwIndex); -#endif - } +/** + * \brief Get the minimum setting attribute. + * This function isn't implemented. The min value is 0. + */ static void usb_get_min (void) { uint8_t LwValue = Usb_read_byte(); @@ -756,10 +775,12 @@ #ifdef USB_ENUM_DEBUG printf("GET MIN %BX %BX %BX %BX Answer",LwValue,HwValue,LwIndex,HwIndex); #endif - - } +/** + * \brief Get the maximum setting attribute. + * This function isn't implemented. The max value is 10. + */ static void usb_get_max (void) { uint8_t LwValue = Usb_read_byte(); @@ -782,10 +803,12 @@ #ifdef USB_ENUM_DEBUG printf("GET MAX %BX %BX %BX %BX Answer",LwValue,HwValue,LwIndex,HwIndex); #endif - - } +/** + * \brief Get the volume step setting attribute. + * This function isn't implemented, the resolution is 1. + */ static void usb_get_res (void) { uint8_t LwValue = Usb_read_byte(); @@ -808,27 +831,12 @@ #ifdef USB_ENUM_DEBUG printf("GET RES %BX %BX %BX %BX Answer",LwValue,HwValue,LwIndex,HwIndex); #endif - - } - -/*F************************************************************************** - * NAME: usb_set_current - *---------------------------------------------------------------------------- - * PARAMS: - * - * return: - *---------------------------------------------------------------------------- - * PURPOSE: - * - *---------------------------------------------------------------------------- - * EXAMPLE: - *---------------------------------------------------------------------------- - * NOTE: - *---------------------------------------------------------------------------- - * REQUIREMENTS: - *****************************************************************************/ +/** + * \brief Set the current setting attribute. + * This request define the current value. This function isn't implemented. + */ static void usb_set_current (void) { uint8_t LwValue = Usb_read_byte(); @@ -846,13 +854,12 @@ printf("SET CURRENT %BX %BX %BX %BX Answer",LwValue,HwValue,\ LwIndex,HwIndex); #endif - -#ifdef USB_ENUM_DEBUG - printf("GET CURRENT %BX %BX %BX %BX STALL",LwValue,HwValue,LwIndex,HwIndex); -#endif - } +/** + * \brief Set minimum setting attribute. + * This function isn't implemented. + */ static void usb_set_min (void) { uint8_t LwValue = Usb_read_byte(); @@ -869,10 +876,12 @@ #ifdef USB_ENUM_DEBUG printf("SET MIN %BX %BX %BX %BX Answer",LwValue,HwValue,LwIndex,HwIndex); #endif - - } +/** + * \brief Set maximum setting attribute. + * This function isn't implemented. + */ static void usb_set_max (void) { uint8_t LwValue = Usb_read_byte(); @@ -889,10 +898,12 @@ #ifdef USB_ENUM_DEBUG printf("SET MAX %BX %BX %BX %BX Answer",LwValue,HwValue,LwIndex,HwIndex); #endif - - } +/** + * \brief Set current setting attribute. + * This function isn't implemented. + */ static void usb_set_res (void) { uint8_t LwValue = Usb_read_byte(); @@ -909,259 +920,15 @@ #ifdef USB_ENUM_DEBUG printf("SET RES %BX %BX %BX %BX Answer",LwValue,HwValue,LwIndex,HwIndex); #endif - - } -/*F************************************************************************** - * NAME: usb_get_configuration - *---------------------------------------------------------------------------- - * PARAMS: - * - * return: - *---------------------------------------------------------------------------- - * PURPOSE: - * This function manages the GET_CONFIGURATION request. - *---------------------------------------------------------------------------- - * EXAMPLE: - *---------------------------------------------------------------------------- - * NOTE: - *---------------------------------------------------------------------------- - * REQUIREMENTS: - *****************************************************************************/ -static void usb_get_configuration (void) -{ - Usb_clear_rx_setup(); - Usb_set_DIR(); +/* HID SPECIFIC REQUESTS */ - Usb_write_byte(usb_configuration_nb); - - Usb_set_tx_ready(); - while (!(Usb_tx_complete())); - Usb_clear_tx_complete(); - while (!(Usb_rx_complete())); - Usb_clear_rx(); - Usb_clear_DIR(); -} - -/*F************************************************************************** - * NAME: usb_get_interface - *---------------------------------------------------------------------------- - * PARAMS: - * - * return: - *---------------------------------------------------------------------------- - * PURPOSE: - * This function manages the GET_INTERFACE request. - *---------------------------------------------------------------------------- - * EXAMPLE: - *---------------------------------------------------------------------------- - * NOTE: - *---------------------------------------------------------------------------- - * REQUIREMENTS: - *****************************************************************************/ -static void usb_get_interface (void) -{ - Usb_clear_rx_setup(); - Usb_set_DIR(); - stall_request(); - Usb_clear_DIR(); -} - - -/*F************************************************************************** - * NAME: usb_get_status - *---------------------------------------------------------------------------- - * PARAMS: - * - * return: - *---------------------------------------------------------------------------- - * PURPOSE: - * This function manages the GET_STATUS request. - *---------------------------------------------------------------------------- - * EXAMPLE: - *---------------------------------------------------------------------------- - * NOTE: - *---------------------------------------------------------------------------- - * REQUIREMENTS: - *****************************************************************************/ -static void usb_get_status (void) -{ - uint8_t wIndex; - - ACC = Usb_read_byte(); /* dummy read */ - ACC = Usb_read_byte(); /* dummy read */ - wIndex = Usb_read_byte(); - Usb_clear_rx_setup(); - Usb_set_DIR(); - switch(bmRequestType) - { - case REQUEST_DEVICE_STATUS: - Usb_write_byte(SELF_POWERED); - break; - - case REQUEST_INTERFACE_STATUS: - Usb_write_byte(0x00); - break; - - case REQUEST_ENDPOINT_STATUS: - wIndex = wIndex & MSK_EP_DIR; - Usb_write_byte(endpoint_status[wIndex]); - break; - } - Usb_write_byte(0x00); - - Usb_set_tx_ready(); - while ((!(Usb_tx_complete())) || (Usb_setup_received())); - Usb_clear_tx_complete(); - while ((!(Usb_rx_complete())) || (Usb_setup_received())); - Usb_clear_rx(); - Usb_clear_DIR(); -} - - -/*F************************************************************************** - * NAME: usb_set_feature - *---------------------------------------------------------------------------- - * PARAMS: - * - * return: - *---------------------------------------------------------------------------- - * PURPOSE: - * This function manages the SET_FEATURE request. - *---------------------------------------------------------------------------- - * EXAMPLE: - *---------------------------------------------------------------------------- - * NOTE: - *---------------------------------------------------------------------------- - * REQUIREMENTS: - *****************************************************************************/ -static void usb_set_feature (void) -{ - if (bmRequestType == ZERO_TYPE) - { - Usb_clear_rx_setup(); - stall_request(); - } - if (bmRequestType == INTERFACE_TYPE) - { - Usb_clear_rx_setup(); - stall_request(); - } - if (bmRequestType == ENDPOINT_TYPE) - { - if (Usb_read_byte() == 0x00) - { - ACC = Usb_read_byte(); /* dummy read */ - switch (Usb_read_byte()) /* check wIndex */ - { - case ENDPOINT_1: - { - Usb_select_ep(EP_IN); - Usb_set_stall_request(); - Usb_select_ep(EP_CONTROL); - endpoint_status[EP_IN] = 0x01; - Usb_clear_rx_setup(); - Usb_set_tx_ready(); - while (!(Usb_tx_complete())); - Usb_clear_tx_complete(); - break; - } - default: - { - Usb_clear_rx_setup(); - stall_request(); - break; - } - } - } - } -} - - -/*F************************************************************************** - * NAME: usb_clear_feature - *---------------------------------------------------------------------------- - * PARAMS: - * - * return: - *---------------------------------------------------------------------------- - * PURPOSE: - * This function manages the SET_FEATURE request. - *---------------------------------------------------------------------------- - * EXAMPLE: - *---------------------------------------------------------------------------- - * NOTE: - *---------------------------------------------------------------------------- - * REQUIREMENTS: - *****************************************************************************/ -static void usb_clear_feature (void) -{ - if (bmRequestType == ZERO_TYPE) - { - Usb_clear_rx_setup(); - stall_request(); - } - if (bmRequestType == INTERFACE_TYPE) - { - Usb_clear_rx_setup(); - stall_request(); - } - if (bmRequestType == ENDPOINT_TYPE) - { - if (Usb_read_byte() == 0x00) - { - ACC = Usb_read_byte(); /* dummy read */ - switch (Usb_read_byte()) /* check wIndex */ - { - case ENDPOINT_1: - { - Usb_select_ep(EP_IN); - Usb_clear_stall_request(); - usb_reset_endpoint(EP_IN); - Usb_select_ep(EP_CONTROL); - endpoint_status[EP_IN] = 0x00; - Usb_clear_rx_setup(); - Usb_set_tx_ready(); - while (!(Usb_tx_complete())); - Usb_clear_tx_complete(); - break; - } - case ENDPOINT_0: - { - Usb_clear_rx_setup(); - Usb_set_tx_ready(); - while (!(Usb_tx_complete())); - Usb_clear_tx_complete(); - break; - } - default: - { - Usb_clear_rx_setup(); - stall_request(); - break; - } - } - } - } -} - -/*F************************************************************************** -* NAME: usb_hid_set_report -*---------------------------------------------------------------------------- -* PARAMS: -* -* return: -*---------------------------------------------------------------------------- -* PURPOSE: -* This function manages the SET_REPORT request (HID Class) -*---------------------------------------------------------------------------- -* EXAMPLE: -*---------------------------------------------------------------------------- -* NOTE: -*---------------------------------------------------------------------------- -* REQUIREMENTS: -*****************************************************************************/ +/** + * \brief HID_SET_REPORT request. + * This function is used to receive a report using a control transfert. + * HID use interrupt transfert, so this function isn't implemented. + */ static void usb_hid_set_report (void) { Usb_clear_rx_setup(); @@ -1172,49 +939,24 @@ send_zlp(); } - - -/*F************************************************************************** -* NAME: usb_hid_set_idle -*---------------------------------------------------------------------------- -* PARAMS: -* -* return: -*---------------------------------------------------------------------------- -* PURPOSE: -* This function manages the HID_SET_IDLE request. -*---------------------------------------------------------------------------- -* EXAMPLE: -*---------------------------------------------------------------------------- -* NOTE: -*---------------------------------------------------------------------------- -* REQUIREMENTS: -*****************************************************************************/ +/** + * \brief SET_IDLE request. + * This request is used to save bandwidth by limiting the reporting frequency of + * an interrupt EP when data hasn't changed since the last report. + */ static void usb_hid_set_idle (void) { ACC = Usb_read_byte(); - hid_idle_duration = Usb_read_byte(); /* wValue contains the duration */ + hid_idle_duration = Usb_read_byte(); Usb_clear_rx_setup(); send_zlp(); } -/*F************************************************************************** -* NAME: usb_hid_get_idle -*---------------------------------------------------------------------------- -* PARAMS: -* -* return: -*---------------------------------------------------------------------------- -* PURPOSE: -* This function manages the GET_IDLE request. -*---------------------------------------------------------------------------- -* EXAMPLE: -*---------------------------------------------------------------------------- -* NOTE: -*---------------------------------------------------------------------------- -* REQUIREMENTS: -*****************************************************************************/ +/** + * \brief HID_GET_IDLE request. + * The host want to know the current idle rate. + */ static void usb_hid_get_idle (void) { Usb_clear_rx_setup(); @@ -1228,6 +970,11 @@ Usb_clear_DIR(); } +/* MISC FUNCTIONS */ + +/** + * \brief Send a stall request. (handshake). + */ static void stall_request(void) { Usb_set_stall_request(); @@ -1236,6 +983,9 @@ Usb_clear_stalled(); } +/** + * \brief This function send a zero length packet. + */ static void send_zlp(void) { Usb_set_tx_ready(); |
From: Paul_R <c2m...@c2...> - 2008-05-15 14:19:11
|
Author: Paul_R Date: 2008-05-15 16:19:14 +0200 (Thu, 15 May 2008) New Revision: 1157 Modified: firmware/fuxusb/trunk/fuxusb.Opt firmware/fuxusb/trunk/src/bootloader.c firmware/fuxusb/trunk/src/config.h firmware/fuxusb/trunk/src/lib_mcu/uart/uart_lib.c firmware/fuxusb/trunk/src/spi_task.c Log: * Typo : replaced TRUE/FALSE by True/False Modified: firmware/fuxusb/trunk/fuxusb.Opt =================================================================== (Binary files differ) Modified: firmware/fuxusb/trunk/src/bootloader.c =================================================================== --- firmware/fuxusb/trunk/src/bootloader.c 2008-05-15 14:14:49 UTC (rev 1156) +++ firmware/fuxusb/trunk/src/bootloader.c 2008-05-15 14:19:14 UTC (rev 1157) @@ -72,7 +72,7 @@ #ifdef BL_DEBUG printf("INIT FAIL \n"); #endif - bl_acknowledge(FALSE, 1, 0, 0); + bl_acknowledge(False, 1, 0, 0); bl_exit(); } @@ -85,7 +85,7 @@ #ifdef BL_DEBUG printf("FLAG :: %BX \n", (uint8_t)(i2c_bootloading_Flag)); #endif - bl_acknowledge(TRUE, 2, 0, 0); + bl_acknowledge(True, 2, 0, 0); } else if (command_received[0] == BOOT_FILLPAGE) { @@ -112,7 +112,7 @@ else if (packet_idx >= packets_per_page) { /* Exit bootloader mode */ - bl_acknowledge(FALSE, 5, 0, 0); + bl_acknowledge(False, 5, 0, 0); bl_exit(); } } @@ -169,7 +169,7 @@ blHeader.page_address != 0x1DC0 && \ blHeader.page_address != 0x0EC0) || Command_Ctr != 35) { - bl_acknowledge(FALSE, 3, 0, 0); + bl_acknowledge(False, 3, 0, 0); bl_exit(); } @@ -187,7 +187,7 @@ if (Command_Ctr != 33) { /* Exit bootloader mode */ - bl_acknowledge(FALSE, 4, 0, 0); + bl_acknowledge(False, 4, 0, 0); bl_exit(); } @@ -226,7 +226,7 @@ EX0 = 0; /* Disable INT0 interrupt */ /* Acknoledge the boot init */ - bl_acknowledge(TRUE, 1, 0, 0); + bl_acknowledge(True, 1, 0, 0); } /** Modified: firmware/fuxusb/trunk/src/config.h =================================================================== --- firmware/fuxusb/trunk/src/config.h 2008-05-15 14:14:49 UTC (rev 1156) +++ firmware/fuxusb/trunk/src/config.h 2008-05-15 14:19:14 UTC (rev 1157) @@ -51,8 +51,8 @@ #define BDR_GENERATOR BRG_TIMER2 /* Misc */ -#define False FALSE -#define True TRUE +#define False 0 +#define True 1 /* USB Configuration */ /* Endpoints */ Modified: firmware/fuxusb/trunk/src/lib_mcu/uart/uart_lib.c =================================================================== --- firmware/fuxusb/trunk/src/lib_mcu/uart/uart_lib.c 2008-05-15 14:14:49 UTC (rev 1156) +++ firmware/fuxusb/trunk/src/lib_mcu/uart/uart_lib.c 2008-05-15 14:19:14 UTC (rev 1157) @@ -140,7 +140,7 @@ uart_clrscr(); uart_puts(txt_logo_atmel); } -return state_uart_splash=TRUE; +return state_uart_splash=True; } #endif @@ -231,7 +231,7 @@ Uart_hw_init(UART_CONFIG); Uart_set_baudrate(BAUDRATE); Uart_enable(); -return TRUE; +return True; } Modified: firmware/fuxusb/trunk/src/spi_task.c =================================================================== --- firmware/fuxusb/trunk/src/spi_task.c 2008-05-15 14:14:49 UTC (rev 1156) +++ firmware/fuxusb/trunk/src/spi_task.c 2008-05-15 14:19:14 UTC (rev 1157) @@ -309,7 +309,7 @@ { new_cmd_enabled = True; //new_cmd_enabled = True; -// USB_StatusProcess_Permit_Flag = TRUE; +// USB_StatusProcess_Permit_Flag = True; spi_Start_Flag = 0; SPI_CSn = 1; // Chip deselect spi_enable = 1; |