Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
d71cd86d
Commit
d71cd86d
authored
11 years ago
by
Damien George
Browse files
Options
Downloads
Plain Diff
Merge branch 'iabdalkader-master'
Conflicts: stm/usb.c stm/usb.h
parents
01156d51
565fdccf
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
stm/stmusbd/usbd_cdc_vcp.c
+4
-1
4 additions, 1 deletion
stm/stmusbd/usbd_cdc_vcp.c
stm/stmusbd/usbd_pyb_core.c
+1
-1
1 addition, 1 deletion
stm/stmusbd/usbd_pyb_core.c
stm/usb.c
+5
-0
5 additions, 0 deletions
stm/usb.c
stm/usb.h
+1
-0
1 addition, 0 deletions
stm/usb.h
with
11 additions
and
2 deletions
stm/stmusbd/usbd_cdc_vcp.c
+
4
−
1
View file @
d71cd86d
...
...
@@ -48,6 +48,9 @@ LINE_CODING linecoding =
/* These are external variables imported from CDC core to be used for IN
transfer management. */
extern
uint32_t
APP_dev_is_connected
;
// set if CDC device is connected
extern
uint8_t
APP_Rx_Buffer
[];
/* Write CDC received data in this buffer.
These data will be sent over USB IN endpoint
in the CDC core functions. */
...
...
@@ -158,7 +161,7 @@ static uint16_t VCP_Ctrl (uint32_t Cmd, uint8_t* Buf, uint32_t Len)
break
;
case
SET_CONTROL_LINE_STATE
:
/* Not needed for this driver */
APP_dev_is_connected
=
Len
&
0x1
;
// wValue is passed in Len (bit of a hack)
break
;
case
SEND_BREAK
:
...
...
This diff is collapsed.
Click to expand it.
stm/stmusbd/usbd_pyb_core.c
+
1
−
1
View file @
d71cd86d
...
...
@@ -648,7 +648,7 @@ static uint8_t usbd_pyb_Setup(void *pdev, USB_SETUP_REQ *req) {
// Not a Data request
// Transfer the command to the interface layer */
return
VCP_fops
.
pIf_Ctrl
(
req
->
bRequest
,
NULL
,
0
);
return
VCP_fops
.
pIf_Ctrl
(
req
->
bRequest
,
NULL
,
req
->
wValue
);
}
}
else
if
(
req
->
wIndex
==
2
)
{
...
...
This diff is collapsed.
Click to expand it.
stm/usb.c
+
5
−
0
View file @
d71cd86d
...
...
@@ -21,6 +21,7 @@ extern CDC_IF_Prop_TypeDef VCP_fops;
USB_OTG_CORE_HANDLE
USB_OTG_Core
;
static
int
dev_is_enabled
=
0
;
uint32_t
APP_dev_is_connected
=
0
;
/* used by usbd_cdc_vcp */
static
char
rx_buf
[
64
];
static
int
rx_buf_in
;
static
int
rx_buf_out
;
...
...
@@ -48,6 +49,10 @@ bool usb_vcp_is_enabled(void) {
return
dev_is_enabled
;
}
bool
usb_vcp_is_connected
(
void
)
{
return
APP_dev_is_connected
;
}
void
usb_vcp_set_interrupt_char
(
int
c
)
{
if
(
dev_is_enabled
)
{
interrupt_char
=
c
;
...
...
This diff is collapsed.
Click to expand it.
stm/usb.h
+
1
−
0
View file @
d71cd86d
...
...
@@ -4,6 +4,7 @@
void
pyb_usb_dev_init
(
void
);
bool
usb_vcp_is_enabled
(
void
);
bool
usb_vcp_is_connected
(
void
);
void
usb_vcp_set_interrupt_char
(
int
c
);
int
usb_vcp_rx_any
(
void
);
char
usb_vcp_rx_get
(
void
);
...
...
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