clang format

input_events
NepEgor 3 years ago
parent b5ab8e525b
commit 6403ac5ac5

@ -0,0 +1,29 @@
UseTab: false
IndentWidth: 4
#AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: true
ColumnLimit: 0
PointerAlignment: Left
#AlignConsecutiveAssignments: AcrossEmptyLinesAndComments
#AlignConsecutiveDeclarations: AcrossEmptyLinesAndComments
AlignConsecutiveMacros: AcrossEmptyLinesAndComments
AlignAfterOpenBracket: true
BreakBeforeBraces: Custom
SortIncludes: false
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: false
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
BeforeWhile: true
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false

@ -34,8 +34,8 @@ USBD_HID_HandleTypeDef;
extern USBD_ClassTypeDef USBD_CUSTOM_HID;
#define USBD_CUSTOM_HID_CLASS &USBD_CUSTOM_HID
uint8_t USBD_HID_CUSTOM_SendReport(USBD_HandleTypeDef *pdev, uint8_t *report, uint16_t len);
uint8_t USBD_HID_CUSTOM_SendReport(USBD_HandleTypeDef* pdev, uint8_t* report, uint16_t len);
uint32_t USBD_HID_GetPollingInterval(USBD_HandleTypeDef *pdev);
uint32_t USBD_HID_GetPollingInterval(USBD_HandleTypeDef* pdev);
#endif

@ -4,6 +4,6 @@
void HID_Custom_Init();
void HID_Custom_DeInit();
void HID_Custom_sendReport(uint8_t *report, uint16_t len);
void HID_Custom_sendReport(uint8_t* report, uint16_t len);
#endif

@ -3,18 +3,18 @@
#include "usbd_descriptors.h"
static uint8_t USBD_HID_Init(USBD_HandleTypeDef *pdev, uint8_t cfgidx);
static uint8_t USBD_HID_DeInit(USBD_HandleTypeDef *pdev, uint8_t cfgidx);
static uint8_t USBD_HID_Init(USBD_HandleTypeDef* pdev, uint8_t cfgidx);
static uint8_t USBD_HID_DeInit(USBD_HandleTypeDef* pdev, uint8_t cfgidx);
static uint8_t USBD_CUSTOM_HID_Setup(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req);
static uint8_t USBD_HID_MOUSE_Setup(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req);
static uint8_t USBD_CUSTOM_HID_Setup(USBD_HandleTypeDef* pdev, USBD_SetupReqTypedef* req);
static uint8_t USBD_HID_MOUSE_Setup(USBD_HandleTypeDef* pdev, USBD_SetupReqTypedef* req);
static uint8_t *USBD_HID_GetFSCfgDesc(uint16_t *length);
static uint8_t *USBD_HID_GetHSCfgDesc(uint16_t *length);
static uint8_t *USBD_HID_GetOtherSpeedCfgDesc(uint16_t *length);
static uint8_t *USBD_HID_GetDeviceQualifierDesc(uint16_t *length);
static uint8_t* USBD_HID_GetFSCfgDesc(uint16_t* length);
static uint8_t* USBD_HID_GetHSCfgDesc(uint16_t* length);
static uint8_t* USBD_HID_GetOtherSpeedCfgDesc(uint16_t* length);
static uint8_t* USBD_HID_GetDeviceQualifierDesc(uint16_t* length);
static uint8_t USBD_HID_DataIn(USBD_HandleTypeDef *pdev, uint8_t epnum);
static uint8_t USBD_HID_DataIn(USBD_HandleTypeDef* pdev, uint8_t epnum);
USBD_ClassTypeDef USBD_CUSTOM_HID = {
USBD_HID_Init,
@ -33,7 +33,7 @@ USBD_ClassTypeDef USBD_CUSTOM_HID = {
USBD_HID_GetDeviceQualifierDesc,
};
static uint8_t USBD_HID_Init(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
static uint8_t USBD_HID_Init(USBD_HandleTypeDef* pdev, uint8_t cfgidx)
{
UNUSED(cfgidx);
uint8_t ret = USBD_OK;
@ -57,14 +57,14 @@ static uint8_t USBD_HID_Init(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
}
else
{
((USBD_HID_HandleTypeDef *)pdev->pClassData)->Mousestate = HID_IDLE;
((USBD_HID_HandleTypeDef*)pdev->pClassData)->Mousestate = HID_IDLE;
//((USBD_HID_HandleTypeDef *)pdev->pClassData)->Keyboardstate = HID_IDLE;
}
return ret;
}
static uint8_t USBD_HID_DeInit(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
static uint8_t USBD_HID_DeInit(USBD_HandleTypeDef* pdev, uint8_t cfgidx)
{
UNUSED(cfgidx);
/* Close HID EPs */
@ -84,7 +84,7 @@ static uint8_t USBD_HID_DeInit(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
return USBD_OK;
}
static uint8_t USBD_CUSTOM_HID_Setup(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
static uint8_t USBD_CUSTOM_HID_Setup(USBD_HandleTypeDef* pdev, USBD_SetupReqTypedef* req)
{
/* Check which interface is targetted by this request */
//if ((req->wIndex & 0x00FF) == HID_KEYBOARD_INTERFACE)
@ -97,11 +97,11 @@ static uint8_t USBD_CUSTOM_HID_Setup(USBD_HandleTypeDef *pdev, USBD_SetupReqType
//}
}
static uint8_t USBD_HID_MOUSE_Setup(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
static uint8_t USBD_HID_MOUSE_Setup(USBD_HandleTypeDef* pdev, USBD_SetupReqTypedef* req)
{
USBD_HID_HandleTypeDef *hhid = (USBD_HID_HandleTypeDef*)pdev->pClassData;
USBD_HID_HandleTypeDef* hhid = (USBD_HID_HandleTypeDef*)pdev->pClassData;
uint16_t len = 0U;
uint8_t *pbuf = NULL;
uint8_t* pbuf = NULL;
uint16_t status_info = 0U;
USBD_StatusTypeDef ret = USBD_OK;
@ -115,7 +115,7 @@ static uint8_t USBD_HID_MOUSE_Setup(USBD_HandleTypeDef *pdev, USBD_SetupReqTyped
break;
case HID_REQ_GET_PROTOCOL:
USBD_CtlSendData(pdev, (uint8_t *)&hhid->Protocol, 1U);
USBD_CtlSendData(pdev, (uint8_t*)&hhid->Protocol, 1U);
break;
case HID_REQ_SET_IDLE:
@ -123,7 +123,7 @@ static uint8_t USBD_HID_MOUSE_Setup(USBD_HandleTypeDef *pdev, USBD_SetupReqTyped
break;
case HID_REQ_GET_IDLE:
USBD_CtlSendData(pdev, (uint8_t *)&hhid->IdleState, 1U);
USBD_CtlSendData(pdev, (uint8_t*)&hhid->IdleState, 1U);
break;
default:
@ -139,7 +139,7 @@ static uint8_t USBD_HID_MOUSE_Setup(USBD_HandleTypeDef *pdev, USBD_SetupReqTyped
case USB_REQ_GET_STATUS:
if (pdev->dev_state == USBD_STATE_CONFIGURED)
{
USBD_CtlSendData(pdev, (uint8_t *)(void *)&status_info, 2U);
USBD_CtlSendData(pdev, (uint8_t*)(void*)&status_info, 2U);
}
else
{
@ -168,10 +168,10 @@ static uint8_t USBD_HID_MOUSE_Setup(USBD_HandleTypeDef *pdev, USBD_SetupReqTyped
USBD_CtlSendData(pdev, pbuf, len);
break;
case USB_REQ_GET_INTERFACE :
case USB_REQ_GET_INTERFACE:
if (pdev->dev_state == USBD_STATE_CONFIGURED)
{
USBD_CtlSendData(pdev, (uint8_t *)&hhid->AltSetting, 1U);
USBD_CtlSendData(pdev, (uint8_t*)&hhid->AltSetting, 1U);
}
else
{
@ -180,7 +180,7 @@ static uint8_t USBD_HID_MOUSE_Setup(USBD_HandleTypeDef *pdev, USBD_SetupReqTyped
}
break;
case USB_REQ_SET_INTERFACE :
case USB_REQ_SET_INTERFACE:
if (pdev->dev_state == USBD_STATE_CONFIGURED)
{
hhid->AltSetting = (uint8_t)(req->wValue);
@ -223,7 +223,7 @@ uint8_t USBD_HID_CUSTOM_SendReport(USBD_HandleTypeDef* pdev, uint8_t* report, ui
return USBD_OK;
}
uint32_t USBD_HID_GetPollingInterval(USBD_HandleTypeDef *pdev)
uint32_t USBD_HID_GetPollingInterval(USBD_HandleTypeDef* pdev)
{
uint32_t polling_interval = 0U;
@ -245,25 +245,25 @@ uint32_t USBD_HID_GetPollingInterval(USBD_HandleTypeDef *pdev)
return ((uint32_t)(polling_interval));
}
static uint8_t *USBD_HID_GetFSCfgDesc(uint16_t *length)
static uint8_t* USBD_HID_GetFSCfgDesc(uint16_t* length)
{
*length = sizeof(USBD_HID_CUSTOM_CfgFSDesc);
return USBD_HID_CUSTOM_CfgFSDesc;
}
static uint8_t *USBD_HID_GetHSCfgDesc(uint16_t *length)
static uint8_t* USBD_HID_GetHSCfgDesc(uint16_t* length)
{
*length = sizeof(USBD_HID_CUSTOM_CfgHSDesc);
return USBD_HID_CUSTOM_CfgHSDesc;
}
static uint8_t *USBD_HID_GetOtherSpeedCfgDesc(uint16_t *length)
static uint8_t* USBD_HID_GetOtherSpeedCfgDesc(uint16_t* length)
{
*length = sizeof(USBD_HID_CUSTOM_OtherSpeedCfgDesc);
return USBD_HID_CUSTOM_OtherSpeedCfgDesc;
}
static uint8_t USBD_HID_DataIn(USBD_HandleTypeDef *pdev, uint8_t epnum)
static uint8_t USBD_HID_DataIn(USBD_HandleTypeDef* pdev, uint8_t epnum)
{
/* Ensure that the FIFO is empty before a new transfer, this condition could
be caused by a new transfer before the end of the previous transfer */
@ -278,8 +278,7 @@ static uint8_t USBD_HID_DataIn(USBD_HandleTypeDef *pdev, uint8_t epnum)
return USBD_OK;
}
static uint8_t *USBD_HID_GetDeviceQualifierDesc(uint16_t *length)
static uint8_t* USBD_HID_GetDeviceQualifierDesc(uint16_t* length)
{
*length = sizeof(USBD_HID_DeviceQualifierDesc);
return USBD_HID_DeviceQualifierDesc;

@ -29,7 +29,7 @@ void HID_Custom_DeInit()
}
}
void HID_Custom_sendReport(uint8_t *report, uint16_t len)
void HID_Custom_sendReport(uint8_t* report, uint16_t len)
{
USBD_HID_CUSTOM_SendReport(&hUSBD_Device_HID, report, len);
}

Loading…
Cancel
Save