Merge pull request #11198 from SteveCEvans/sce_rc2
[betaflight.git] / src / main / vcp / usb_endp.c
blobb73939286816cdf99dc5f4a2851d66a653cc7444
1 /**
2 ******************************************************************************
3 * @file usb_endp.c
4 * @author MCD Application Team
5 * @version V4.0.0
6 * @date 21-January-2013
7 * @brief Endpoint routines
8 ******************************************************************************
9 * @attention
11 * <h2><center>&copy; COPYRIGHT 2013 STMicroelectronics</center></h2>
13 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
14 * You may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at:
17 * http://www.st.com/software_license_agreement_liberty_v2
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
25 ******************************************************************************
28 /* Includes ------------------------------------------------------------------*/
30 #include "platform.h"
32 #include "usb_lib.h"
33 #include "usb_desc.h"
34 #include "usb_mem.h"
35 #include "hw_config.h"
36 #include "usb_istr.h"
37 #include "usb_pwr.h"
39 /* Private typedef -----------------------------------------------------------*/
40 /* Private define ------------------------------------------------------------*/
42 /* Interval between sending IN packets in frame number (1 frame = 1ms) */
43 #define VCOMPORT_IN_FRAME_INTERVAL 5
44 /* Private macro -------------------------------------------------------------*/
45 /* Private variables ---------------------------------------------------------*/
46 extern __IO uint32_t packetSent; // HJI
47 extern __IO uint8_t receiveBuffer[64]; // HJI
48 __IO uint32_t receiveLength; // HJI
49 /* Private function prototypes -----------------------------------------------*/
50 /* Private functions ---------------------------------------------------------*/
52 /*******************************************************************************
53 * Function Name : EP1_IN_Callback
54 * Description :
55 * Input : None.
56 * Output : None.
57 * Return : None.
58 *******************************************************************************/
60 void EP1_IN_Callback(void)
62 packetSent = 0; // HJI
65 /*******************************************************************************
66 * Function Name : EP3_OUT_Callback
67 * Description :
68 * Input : None.
69 * Output : None.
70 * Return : None.
71 *******************************************************************************/
72 void EP3_OUT_Callback(void)
74 receiveLength = GetEPRxCount(ENDP3); // HJI
75 PMAToUserBufferCopy((unsigned char*)receiveBuffer, ENDP3_RXADDR, receiveLength); // HJI
78 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/