Skip to content

Commit 02795f1

Browse files
committed
chore(cdc): updates regarding EP_IN_FLAG
1 parent d61f000 commit 02795f1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

micropython/usbd/cdc.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
)
77
from .utils import (
88
endpoint_descriptor,
9-
EP_OUT_FLAG
9+
EP_IN_FLAG
1010
)
1111
from micropython import const
1212
import ustruct
@@ -63,8 +63,8 @@ def get_itf_descriptor(self, num_eps, itf_idx, str_idx):
6363
return desc, strs
6464

6565
def get_endpoint_descriptors(self, ep_addr, str_idx):
66-
self.ep_in = endpoint_descriptor((ep_addr + 1) | EP_OUT_FLAG, "interrupt", 8, 16)
67-
return (self.ep_in, [], ((ep_addr+1) | EP_OUT_FLAG,))
66+
self.ep_in = endpoint_descriptor((ep_addr + 1) | EP_IN_FLAG, "interrupt", 8, 16)
67+
return (self.ep_in, [], ((ep_addr+1) | EP_IN_FLAG,))
6868

6969

7070
class CDCDataInterface(USBInterface):
@@ -80,9 +80,8 @@ def __init__(self, interface_str, timeout=1):
8080
self.timeout = timeout
8181

8282
def get_endpoint_descriptors(self, ep_addr, str_idx):
83-
# XXX OUT = 0x00 but is defined as 0x80?
84-
self.ep_in = (ep_addr + 2) | EP_OUT_FLAG
85-
self.ep_out = (ep_addr + 2) & ~EP_OUT_FLAG
83+
self.ep_in = (ep_addr + 2) | EP_IN_FLAG
84+
self.ep_out = (ep_addr + 2) & ~EP_IN_FLAG
8685
# one IN / OUT Endpoint
8786
e_out = endpoint_descriptor(self.ep_out, "bulk", 64, 0)
8887
e_in = endpoint_descriptor(self.ep_in, "bulk", 64, 0)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy