Another fix format

pull/115/head
D.R.racer 2021-09-23 13:40:15 +02:00
parent cddc16dc2e
commit 10e08021fb
2 changed files with 53 additions and 59 deletions

View File

@ -36,75 +36,72 @@
#ifndef _DESCRIPTORS_H_ #ifndef _DESCRIPTORS_H_
#define _DESCRIPTORS_H_ #define _DESCRIPTORS_H_
/* Includes: */ /* Includes: */
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include "lufa/LUFA/Drivers/USB/USB.h" #include "lufa/LUFA/Drivers/USB/USB.h"
/* Macros: */ /* Macros: */
/** Endpoint address of the CDC device-to-host notification IN endpoint. */ /** Endpoint address of the CDC device-to-host notification IN endpoint. */
#define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2) #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2)
/** Endpoint address of the CDC device-to-host data IN endpoint. */ /** Endpoint address of the CDC device-to-host data IN endpoint. */
#define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3) #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3)
/** Endpoint address of the CDC host-to-device data OUT endpoint. */ /** Endpoint address of the CDC host-to-device data OUT endpoint. */
#define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4) #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4)
/** Size in bytes of the CDC device-to-host notification IN endpoint. */ /** Size in bytes of the CDC device-to-host notification IN endpoint. */
#define CDC_NOTIFICATION_EPSIZE 8 #define CDC_NOTIFICATION_EPSIZE 8
/** Size in bytes of the CDC data IN and OUT endpoints. */ /** Size in bytes of the CDC data IN and OUT endpoints. */
#define CDC_TXRX_EPSIZE 16 #define CDC_TXRX_EPSIZE 16
/* Type Defines: */ /* Type Defines: */
/** Type define for the device configuration descriptor structure. This must be defined in the /** Type define for the device configuration descriptor structure. This must be defined in the
* application code, as the configuration descriptor contains several sub-descriptors which * application code, as the configuration descriptor contains several sub-descriptors which
* vary between devices, and which describe the device's usage to the host. * vary between devices, and which describe the device's usage to the host.
*/ */
typedef struct typedef struct
{ {
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
// CDC Control Interface // CDC Control Interface
USB_Descriptor_Interface_t CDC_CCI_Interface; USB_Descriptor_Interface_t CDC_CCI_Interface;
USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header; USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header;
USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM; USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM;
USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union; USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union;
USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; USB_Descriptor_Endpoint_t CDC_NotificationEndpoint;
// CDC Data Interface // CDC Data Interface
USB_Descriptor_Interface_t CDC_DCI_Interface; USB_Descriptor_Interface_t CDC_DCI_Interface;
USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; USB_Descriptor_Endpoint_t CDC_DataOutEndpoint;
USB_Descriptor_Endpoint_t CDC_DataInEndpoint; USB_Descriptor_Endpoint_t CDC_DataInEndpoint;
} USB_Descriptor_Configuration_t; } USB_Descriptor_Configuration_t;
/** Enum for the device interface descriptor IDs within the device. Each interface descriptor /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
* should have a unique ID index associated with it, which can be used to refer to the * should have a unique ID index associated with it, which can be used to refer to the
* interface from other descriptors. * interface from other descriptors.
*/ */
enum InterfaceDescriptors_t enum InterfaceDescriptors_t {
{ INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI interface descriptor ID */
INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI interface descriptor ID */ INTERFACE_ID_CDC_DCI = 1, /**< CDC DCI interface descriptor ID */
INTERFACE_ID_CDC_DCI = 1, /**< CDC DCI interface descriptor ID */ };
};
/** Enum for the device string descriptor IDs within the device. Each string descriptor should /** Enum for the device string descriptor IDs within the device. Each string descriptor should
* have a unique ID index associated with it, which can be used to refer to the string from * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t {
{ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Product = 2, /**< Product string ID */
STRING_ID_Product = 2, /**< Product string ID */ };
};
/* Function Prototypes: */ /* Function Prototypes: */
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint16_t wIndex, const uint16_t wIndex,
const void** const DescriptorAddress) const void **const DescriptorAddress)
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
#endif #endif

View File

@ -1,7 +1,4 @@
target_sources( target_sources(firmware PRIVATE main.cpp)
firmware
PRIVATE main.cpp
)
target_link_libraries(firmware LUFA) target_link_libraries(firmware LUFA)
@ -9,12 +6,12 @@ set_property(
SOURCE src/version.c SOURCE src/version.c
APPEND APPEND
PROPERTY COMPILE_DEFINITIONS PROPERTY COMPILE_DEFINITIONS
FW_BUILD_NUMBER=${BUILD_NUMBER} FW_BUILD_NUMBER=${BUILD_NUMBER}
FW_VERSION_FULL=${PROJECT_VERSION_FULL} FW_VERSION_FULL=${PROJECT_VERSION_FULL}
FW_VERSION=${PROJECT_VERSION} FW_VERSION=${PROJECT_VERSION}
FW_VERSION_SUFFIX=${PROJECT_VERSION_SUFFIX} FW_VERSION_SUFFIX=${PROJECT_VERSION_SUFFIX}
FW_VERSION_SUFFIX_SHORT=${PROJECT_VERSION_SUFFIX_SHORT} FW_VERSION_SUFFIX_SHORT=${PROJECT_VERSION_SUFFIX_SHORT}
) )
add_subdirectory(hal) add_subdirectory(hal)
add_subdirectory(logic) add_subdirectory(logic)