mirror of
https://github.com/candle-usb/candleLight_fw.git
synced 2025-01-28 06:02:52 +08:00
usbd_gs_can: USBD_GS_CAN_PrepareReceive(): mark as static
USBD_GS_CAN_PrepareReceive() is only used in usbd_gs_can.c, remove function prototype from usbd_gs_can.h, mark as static, and move in front to avoid forward declaration.
This commit is contained in:
parent
e27abfe173
commit
859b7e3717
@ -66,7 +66,6 @@ void USBD_GS_CAN_SetChannel(USBD_HandleTypeDef *pdev, uint8_t channel, can_data_
|
||||
void USBD_GS_CAN_SuspendCallback(USBD_HandleTypeDef *pdev);
|
||||
void USBD_GS_CAN_ResumeCallback(USBD_HandleTypeDef *pdev);
|
||||
bool USBD_GS_CAN_TxReady(USBD_HandleTypeDef *pdev);
|
||||
uint8_t USBD_GS_CAN_PrepareReceive(USBD_HandleTypeDef *pdev);
|
||||
bool USBD_GS_CAN_CustomDeviceRequest(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req);
|
||||
bool USBD_GS_CAN_CustomInterfaceRequest(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req);
|
||||
|
||||
|
@ -288,6 +288,12 @@ static const struct gs_device_bt_const USBD_GS_CAN_btconst = {
|
||||
1, // brp increment;
|
||||
};
|
||||
|
||||
static inline uint8_t USBD_GS_CAN_PrepareReceive(USBD_HandleTypeDef *pdev)
|
||||
{
|
||||
USBD_GS_CAN_HandleTypeDef *hcan = (USBD_GS_CAN_HandleTypeDef*)pdev->pClassData;
|
||||
return USBD_LL_PrepareReceive(pdev, GSUSB_ENDPOINT_OUT, (uint8_t*)hcan->from_host_buf, sizeof(*hcan->from_host_buf));
|
||||
}
|
||||
|
||||
/* It's unclear from the documentation, but it appears that the USB library is
|
||||
* not safely reentrant. It attempts to signal errors via return values if it is
|
||||
* reentered, but that code is not interrupt-safe and the error values are
|
||||
@ -652,12 +658,6 @@ static uint8_t *USBD_GS_CAN_GetCfgDesc(uint16_t *len)
|
||||
return USBD_DescBuf;
|
||||
}
|
||||
|
||||
inline uint8_t USBD_GS_CAN_PrepareReceive(USBD_HandleTypeDef *pdev)
|
||||
{
|
||||
USBD_GS_CAN_HandleTypeDef *hcan = (USBD_GS_CAN_HandleTypeDef*)pdev->pClassData;
|
||||
return USBD_LL_PrepareReceive(pdev, GSUSB_ENDPOINT_OUT, (uint8_t*)hcan->from_host_buf, sizeof(*hcan->from_host_buf));
|
||||
}
|
||||
|
||||
bool USBD_GS_CAN_TxReady(USBD_HandleTypeDef *pdev)
|
||||
{
|
||||
USBD_GS_CAN_HandleTypeDef *hcan = (USBD_GS_CAN_HandleTypeDef*)pdev->pClassData;
|
||||
|
Loading…
x
Reference in New Issue
Block a user