Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
ac130dc2
Commit
ac130dc2
authored
11 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
CDC/ACM Device: Fixe compilation errors when dual speed support is enabled
parent
f4c1568c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChangeLog
+2
-0
2 additions, 0 deletions
ChangeLog
drivers/usbdev/cdcacm_desc.c
+33
-15
33 additions, 15 deletions
drivers/usbdev/cdcacm_desc.c
with
35 additions
and
15 deletions
ChangeLog
+
2
−
0
View file @
ac130dc2
...
...
@@ -5483,4 +5483,6 @@
* Remove all empty and most useless README.txt files (2013-8-31)
* configs/freedom-kl25z/src/kl_spi.c: Correct typo in name of a
function. From Alan Carvalho de Assis (2013-8-31).
* drivers/usbdev/cdcacm_desc.c: Fixed some compilation errors that
only occur when dual speed support is enabled (2013-9-1).
This diff is collapsed.
Click to expand it.
drivers/usbdev/cdcacm_desc.c
+
33
−
15
View file @
ac130dc2
...
...
@@ -373,6 +373,29 @@ static const struct usb_qualdesc_s g_qualdesc =
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: cdcacm_cpepdesc
*
* Description:
* Copy an endpoint descriptor using the correct max packet size.
*
****************************************************************************/
#ifdef CONFIG_USBDEV_DUALSPEED
void
cdcacm_cpepdesc
(
FAR
const
struct
usb_epdesc_s
*
indesc
,
uint16_t
mxpacket
,
FAR
struct
usb_epdesc_s
*
outdesc
)
{
/* Copy the "canned" descriptor */
memcpy
(
outdesc
,
indesc
,
USB_SIZEOF_EPDESC
);
/* Then add the correct max packet size */
outdesc
->
mxpacketsize
[
0
]
=
LSBYTE
(
mxpacket
);
outdesc
->
mxpacketsize
[
1
]
=
MSBYTE
(
mxpacket
);
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
...
...
@@ -462,7 +485,7 @@ int cdcacm_mkstrdesc(uint8_t id, struct usb_strdesc_s *strdesc)
}
/****************************************************************************
* Name: cdcacm_get
ep
desc
* Name: cdcacm_get
dev
desc
*
* Description:
* Return a pointer to the raw device descriptor
...
...
@@ -512,20 +535,14 @@ FAR const struct usb_epdesc_s *cdcacm_getepdesc(enum cdcacm_epdesc_e epid)
****************************************************************************/
#ifdef CONFIG_USBDEV_DUALSPEED
void
cdcacm_mkepdesc
(
num
cdcacm_epdesc_e
epid
,
uint16_t
mxpacket
,
void
cdcacm_mkepdesc
(
e
num
cdcacm_epdesc_e
epid
,
uint16_t
mxpacket
,
FAR
struct
usb_epdesc_s
*
outdesc
)
{
FAR
const
struct
usb_epdesc_s
*
indesc
;
/* Copy the "canned" descriptor */
indesc
=
cdcacm_getepdesc
(
epid
)
memcpy
(
outdesc
,
indesc
,
USB_SIZEOF_EPDESC
);
/* Then add the correct max packet size */
/* Map the ID to the correct endpoint and let cdcacm_cpepdesc to the real
* work.
*/
outdesc
->
mxpacketsize
[
0
]
=
LSBYTE
(
mxpacket
);
outdesc
->
mxpacketsize
[
1
]
=
MSBYTE
(
mxpacket
);
cdcacm_cpepdesc
(
cdcacm_getepdesc
(
epid
),
mxpacket
,
outdesc
);
}
#endif
...
...
@@ -574,10 +591,11 @@ int16_t cdcacm_mkcfgdesc(FAR uint8_t *buf)
*/
#ifdef CONFIG_USBDEV_DUALSPEED
if
(
hi
gh
speed
&&
group
->
hsepsize
!=
0
)
if
(
hispeed
&&
group
->
hsepsize
!=
0
)
{
cdcacm_mkepdesc
(
group
->
desc
,
group
->
hsepsize
,
(
FAR
struct
usb_epdesc_s
*
)
dest
);
cdcacm_cpepdesc
((
FAR
const
struct
usb_epdesc_s
*
)
group
->
desc
,
group
->
hsepsize
,
(
FAR
struct
usb_epdesc_s
*
)
dest
);
}
else
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment