diff --git a/lib/Descriptors.h b/lib/Descriptors.h index 0325c7d..bbf506f 100644 --- a/lib/Descriptors.h +++ b/lib/Descriptors.h @@ -36,75 +36,72 @@ #ifndef _DESCRIPTORS_H_ #define _DESCRIPTORS_H_ - /* Includes: */ - #include +/* Includes: */ +#include - #include "lufa/LUFA/Drivers/USB/USB.h" +#include "lufa/LUFA/Drivers/USB/USB.h" - /* Macros: */ - /** Endpoint address of the CDC device-to-host notification IN endpoint. */ - #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2) +/* Macros: */ +/** Endpoint address of the CDC device-to-host notification IN endpoint. */ +#define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2) - /** Endpoint address of the CDC device-to-host data IN endpoint. */ - #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3) +/** Endpoint address of the CDC device-to-host data IN endpoint. */ +#define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3) - /** Endpoint address of the CDC host-to-device data OUT endpoint. */ - #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4) +/** Endpoint address of the CDC host-to-device data OUT endpoint. */ +#define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4) - /** Size in bytes of the CDC device-to-host notification IN endpoint. */ - #define CDC_NOTIFICATION_EPSIZE 8 +/** Size in bytes of the CDC device-to-host notification IN endpoint. */ +#define CDC_NOTIFICATION_EPSIZE 8 - /** Size in bytes of the CDC data IN and OUT endpoints. */ - #define CDC_TXRX_EPSIZE 16 +/** Size in bytes of the CDC data IN and OUT endpoints. */ +#define CDC_TXRX_EPSIZE 16 - /* Type Defines: */ - /** Type define for the device configuration descriptor structure. This must be defined in the +/* Type Defines: */ +/** 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 * vary between devices, and which describe the device's usage to the host. */ - typedef struct - { - USB_Descriptor_Configuration_Header_t Config; +typedef struct +{ + USB_Descriptor_Configuration_Header_t Config; - // CDC Control Interface - USB_Descriptor_Interface_t CDC_CCI_Interface; - USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header; - USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM; - USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union; - USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; + // CDC Control Interface + USB_Descriptor_Interface_t CDC_CCI_Interface; + USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header; + USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM; + USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union; + USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; - // CDC Data Interface - USB_Descriptor_Interface_t CDC_DCI_Interface; - USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; - USB_Descriptor_Endpoint_t CDC_DataInEndpoint; - } USB_Descriptor_Configuration_t; + // CDC Data Interface + USB_Descriptor_Interface_t CDC_DCI_Interface; + USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; + USB_Descriptor_Endpoint_t CDC_DataInEndpoint; +} 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 * interface from other descriptors. */ - enum InterfaceDescriptors_t - { - INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI interface descriptor ID */ - INTERFACE_ID_CDC_DCI = 1, /**< CDC DCI interface descriptor ID */ - }; +enum InterfaceDescriptors_t { + INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI 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 * other descriptors. */ - enum StringDescriptors_t - { - STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ - STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ - STRING_ID_Product = 2, /**< Product string ID */ - }; +enum StringDescriptors_t { + STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ + STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ + STRING_ID_Product = 2, /**< Product string ID */ +}; - /* Function Prototypes: */ - uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, - const uint16_t wIndex, - const void** const DescriptorAddress) - ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); +/* Function Prototypes: */ +uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, + const uint16_t wIndex, + const void **const DescriptorAddress) + ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); #endif - diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fce3c5c..e8bf73c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,4 @@ -target_sources( - firmware - PRIVATE main.cpp -) +target_sources(firmware PRIVATE main.cpp) target_link_libraries(firmware LUFA) @@ -9,12 +6,12 @@ set_property( SOURCE src/version.c APPEND PROPERTY COMPILE_DEFINITIONS - FW_BUILD_NUMBER=${BUILD_NUMBER} - FW_VERSION_FULL=${PROJECT_VERSION_FULL} - FW_VERSION=${PROJECT_VERSION} - FW_VERSION_SUFFIX=${PROJECT_VERSION_SUFFIX} - FW_VERSION_SUFFIX_SHORT=${PROJECT_VERSION_SUFFIX_SHORT} -) + FW_BUILD_NUMBER=${BUILD_NUMBER} + FW_VERSION_FULL=${PROJECT_VERSION_FULL} + FW_VERSION=${PROJECT_VERSION} + FW_VERSION_SUFFIX=${PROJECT_VERSION_SUFFIX} + FW_VERSION_SUFFIX_SHORT=${PROJECT_VERSION_SUFFIX_SHORT} + ) add_subdirectory(hal) add_subdirectory(logic)