Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
28817725
Commit
28817725
authored
Apr 16, 2014
by
Damien George
Browse files
stmhal: Replace magic number 3 with CDC_IN_EP define.
parent
3f2f2898
Changes
3
Hide whitespace changes
Inline
Side-by-side
stmhal/usbd_cdc_interface.c
View file @
28817725
...
...
@@ -265,10 +265,11 @@ void USBD_CDC_HAL_TIM_PeriodElapsedCallback(void) {
if
(
UserTxBufPtrOut
!=
UserTxBufPtrOutShadow
)
{
// We have sent data and are waiting for the low-level USB driver to
// finish sending it over the USB in-endpoint.
if
(
UserTxBufPtrWaitCount
<
10
)
{
// We have a 15 * 10ms = 150ms timeout
if
(
UserTxBufPtrWaitCount
<
15
)
{
PCD_HandleTypeDef
*
hpcd
=
hUSBDDevice
.
pData
;
USB_OTG_GlobalTypeDef
*
USBx
=
hpcd
->
Instance
;
if
(
USBx_INEP
(
3
)
->
DIEPTSIZ
&
USB_OTG_DIEPTSIZ_XFRSIZ
)
{
if
(
USBx_INEP
(
CDC_IN_EP
&
0x7f
)
->
DIEPTSIZ
&
USB_OTG_DIEPTSIZ_XFRSIZ
)
{
// USB in-endpoint is still reading the data
UserTxBufPtrWaitCount
++
;
return
;
...
...
stmhal/usbdev/class/cdc_msc_hid/inc/usbd_cdc_msc_hid.h
View file @
28817725
...
...
@@ -13,6 +13,11 @@
#define MSC_IN_EP (0x81)
#define MSC_OUT_EP (0x01)
// Need to define here for usbd_cdc_interface.c (it needs CDC_IN_EP)
#define CDC_IN_EP (0x83)
#define CDC_OUT_EP (0x03)
#define CDC_CMD_EP (0x82)
// only CDC_MSC and CDC_HID are available
#define USBD_MODE_CDC (0x01)
#define USBD_MODE_MSC (0x02)
...
...
stmhal/usbdev/class/cdc_msc_hid/src/usbd_cdc_msc_hid.c
View file @
28817725
...
...
@@ -4,9 +4,6 @@
#define USB_CDC_MSC_CONFIG_DESC_SIZ (98)
#define USB_CDC_HID_CONFIG_DESC_SIZ (100)
#define CDC_IFACE_NUM (1)
#define CDC_IN_EP (0x83)
#define CDC_OUT_EP (0x03)
#define CDC_CMD_EP (0x82)
#define MSC_IFACE_NUM (0)
#define HID_IFACE_NUM_WITH_CDC (0)
#define HID_IFACE_NUM_WITH_MSC (1)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment