Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
8f3cf6e6
Commit
8f3cf6e6
authored
Sep 22, 2016
by
Pavol Rusnak
Committed by
Damien George
Oct 04, 2016
Browse files
stmhal/usb: Use correct ClassData structure for HID receive.
parent
eb239b83
Changes
2
Hide whitespace changes
Inline
Side-by-side
stmhal/usbd_hid_interface.c
View file @
8f3cf6e6
...
...
@@ -47,12 +47,11 @@
static
__IO
uint8_t
dev_is_connected
=
0
;
// indicates if we are connected
static
uint8_t
buffer
[
2
][
64
];
// pair of buffers to read individual packets into
static
uint8_t
buffer
[
2
][
HID_DATA_FS_MAX_PACKET_SIZE
];
// pair of buffers to read individual packets into
static
int8_t
current_read_buffer
=
0
;
// which buffer to read from
static
uint32_t
last_read_len
;
// length of last read
static
int8_t
current_write_buffer
=
0
;
// which buffer to write to
static
size_t
rx_packet_size
=
64
;
// expected size of packets to receive
/* Private function prototypes -----------------------------------------------*/
static
int8_t
HID_Itf_Receive
(
uint8_t
*
pbuf
,
uint32_t
Len
);
...
...
stmhal/usbdev/class/src/usbd_cdc_msc_hid.c
View file @
8f3cf6e6
...
...
@@ -53,6 +53,7 @@
#define HID_IN_EP_WITH_CDC (0x81)
#define HID_OUT_EP_WITH_CDC (0x01)
#define HID_IN_EP_WITH_MSC (0x83)
#define HID_OUT_EP_WITH_MSC (0x03)
#define USB_DESC_TYPE_ASSOCIATION (0x0b)
...
...
@@ -613,6 +614,7 @@ int USBD_SelectMode(uint32_t mode, USBD_HID_ModeInfoTypeDef *hid_info) {
// not implemented
case USBD_MODE_MSC_HID:
hid_in_ep = HID_IN_EP_WITH_MSC;
hid_out_ep = HID_OUT_EP_WITH_MSC;
hid_iface_num = HID_IFACE_NUM_WITH_MSC;
break;
*/
...
...
@@ -723,7 +725,7 @@ static uint8_t USBD_CDC_MSC_HID_Init(USBD_HandleTypeDef *pdev, uint8_t cfgidx) {
mps_out
);
// Prepare Out endpoint to receive next packet
USBD_LL_PrepareReceive
(
pdev
,
hid_out_ep
,
CDC
_ClassData
.
RxBuffer
,
mps_out
);
USBD_LL_PrepareReceive
(
pdev
,
hid_out_ep
,
HID
_ClassData
.
RxBuffer
,
mps_out
);
HID_ClassData
.
state
=
HID_IDLE
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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