Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
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
Show more breadcrumbs
card10
firmware
Commits
12992926
Commit
12992926
authored
4 years ago
by
rahix
Browse files
Options
Downloads
Plain Diff
Merge 'Re-enable CDC-ACM after lockup when attached again'
See merge request
card10/firmware!383
parents
4e81cb87
207657e3
No related branches found
No related tags found
1 merge request
!383
fix(usbcdc): Re-enable after lockup when attached again
Pipeline
#4570
passed
4 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
epicardium/usb/cdcacm.c
+12
-2
12 additions, 2 deletions
epicardium/usb/cdcacm.c
with
12 additions
and
2 deletions
epicardium/usb/cdcacm.c
+
12
−
2
View file @
12992926
...
@@ -22,6 +22,8 @@
...
@@ -22,6 +22,8 @@
#include
"FreeRTOS.h"
#include
"FreeRTOS.h"
#include
"task.h"
#include
"task.h"
static
volatile
int
lockup_disable
=
0
;
static
inline
struct
config_descriptor_cdcacm
*
static
inline
struct
config_descriptor_cdcacm
*
descriptors
(
struct
esb_config
*
self
)
descriptors
(
struct
esb_config
*
self
)
{
{
...
@@ -36,15 +38,24 @@ static int cb_acm_read_ready(void)
...
@@ -36,15 +38,24 @@ static int cb_acm_read_ready(void)
return
0
;
return
0
;
}
}
static
int
cb_acm_connected
(
void
)
{
lockup_disable
=
0
;
return
0
;
}
int
esb_cdc_init
(
struct
esb_config
*
self
)
int
esb_cdc_init
(
struct
esb_config
*
self
)
{
{
LOG_DEBUG
(
"cdcacm"
,
"init"
);
LOG_DEBUG
(
"cdcacm"
,
"init"
);
struct
config_descriptor_cdcacm
*
dsc
=
descriptors
(
self
);
struct
config_descriptor_cdcacm
*
dsc
=
descriptors
(
self
);
usb_read_complete
=
0
;
usb_read_complete
=
0
;
int
ret
=
acm_init
(
&
dsc
->
comm_interface
);
acm_register_callback
(
acm_register_callback
(
ACM_CB_READ_READY
,
ACM_CB_READ_READY
,
cb_acm_read_ready
);
//SWYM: actually not needed
cb_acm_read_ready
);
//SWYM: actually not needed
return
acm_init
(
&
dsc
->
comm_interface
);
acm_register_callback
(
ACM_CB_CONNECTED
,
cb_acm_connected
);
return
ret
;
}
}
int
esb_cdc_configure
(
struct
esb_config
*
self
)
int
esb_cdc_configure
(
struct
esb_config
*
self
)
...
@@ -96,7 +107,6 @@ uint8_t cdcacm_read(void)
...
@@ -96,7 +107,6 @@ uint8_t cdcacm_read(void)
void
cdcacm_write
(
uint8_t
*
data
,
int
len
)
void
cdcacm_write
(
uint8_t
*
data
,
int
len
)
{
{
static
int
lockup_disable
=
0
;
if
(
acm_present
()
&&
!
lockup_disable
)
{
if
(
acm_present
()
&&
!
lockup_disable
)
{
int
ret
=
acm_write
(
data
,
len
);
int
ret
=
acm_write
(
data
,
len
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
...
...
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