Skip to content

Commit a2e95a2

Browse files
committed
Save cpu cycles...
1 parent 3de5213 commit a2e95a2

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

system/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd.c

+3-17
Original file line numberDiff line numberDiff line change
@@ -873,9 +873,6 @@ HAL_StatusTypeDef HAL_PCD_EP_Open(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint
873873
{
874874
ep = &hpcd->OUT_ep[ep_addr & 0x7FU];
875875
}
876-
ep->num = ep_addr & 0x7FU;
877-
878-
ep->is_in = (0x80U & ep_addr) != 0U;
879876
ep->maxpacket = ep_mps;
880877
ep->type = ep_type;
881878

@@ -903,10 +900,7 @@ HAL_StatusTypeDef HAL_PCD_EP_Close(PCD_HandleTypeDef *hpcd, uint8_t ep_addr)
903900
{
904901
ep = &hpcd->OUT_ep[ep_addr & 0x7FU];
905902
}
906-
ep->num = ep_addr & 0x7FU;
907-
908-
ep->is_in = (0x80U & ep_addr) != 0U;
909-
903+
910904
__HAL_LOCK(hpcd);
911905
USB_DeactivateEndpoint(hpcd->Instance , ep);
912906
__HAL_UNLOCK(hpcd);
@@ -932,8 +926,6 @@ HAL_StatusTypeDef HAL_PCD_EP_Receive(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, u
932926
ep->xfer_buff = pBuf;
933927
ep->xfer_len = len;
934928
ep->xfer_count = 0U;
935-
ep->is_in = 0U;
936-
ep->num = ep_addr & 0x7FU;
937929

938930
if ((ep_addr & 0x7FU) == 0U)
939931
{
@@ -975,8 +967,6 @@ HAL_StatusTypeDef HAL_PCD_EP_Transmit(PCD_HandleTypeDef *hpcd, uint8_t ep_addr,
975967
ep->xfer_buff = pBuf;
976968
ep->xfer_len = len;
977969
ep->xfer_count = 0U;
978-
ep->is_in = 1U;
979-
ep->num = ep_addr & 0x7FU;
980970

981971
if ((ep_addr & 0x7FU) == 0U)
982972
{
@@ -1010,9 +1000,7 @@ HAL_StatusTypeDef HAL_PCD_EP_SetStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr)
10101000
}
10111001

10121002
ep->is_stall = 1U;
1013-
ep->num = ep_addr & 0x7FU;
1014-
ep->is_in = ((ep_addr & 0x80U) == 0x80U);
1015-
1003+
10161004
__HAL_LOCK(hpcd);
10171005
USB_EPSetStall(hpcd->Instance , ep);
10181006
if((ep_addr & 0x7FU) == 0U)
@@ -1044,9 +1032,7 @@ HAL_StatusTypeDef HAL_PCD_EP_ClrStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr)
10441032
}
10451033

10461034
ep->is_stall = 0U;
1047-
ep->num = ep_addr & 0x7FU;
1048-
ep->is_in = ((ep_addr & 0x80U) == 0x80U);
1049-
1035+
10501036
__HAL_LOCK(hpcd);
10511037
USB_EPClearStall(hpcd->Instance , ep);
10521038
__HAL_UNLOCK(hpcd);

0 commit comments

Comments
 (0)