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
69775a15
Verified
Commit
69775a15
authored
5 years ago
by
rahix
Browse files
Options
Downloads
Patches
Plain Diff
feat(epicardium): Display all output on CDC-ACM
Closes #67 Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
4b465ff4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!104
Display all output on CDC-ACM
Pipeline
#2020
passed
5 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
epicardium/meson.build
+1
-0
1 addition, 0 deletions
epicardium/meson.build
epicardium/modules/serial.c
+19
-1
19 additions, 1 deletion
epicardium/modules/serial.c
with
20 additions
and
1 deletion
epicardium/meson.build
+
1
−
0
View file @
69775a15
...
...
@@ -85,6 +85,7 @@ elf = executable(
include_directories
:
[
freertos_includes
],
link_args
:
[
'-Wl,-Map='
+
meson
.
current_build_dir
()
+
'/'
+
name
+
'.map'
,
'-Wl,--defsym=_write=_write_epicardium'
,
],
)
...
...
This diff is collapsed.
Click to expand it.
epicardium/modules/serial.c
+
19
−
1
View file @
69775a15
...
...
@@ -49,7 +49,7 @@ int epic_uart_read_char(void)
*/
int
epic_uart_read_str
(
char
*
buf
,
size_t
cnt
)
{
in
t
i
=
0
;
size_
t
i
=
0
;
for
(
i
=
0
;
i
<
cnt
;
i
++
)
{
if
(
xQueueReceive
(
read_queue
,
&
buf
[
i
],
0
)
!=
pdTRUE
)
{
...
...
@@ -60,6 +60,24 @@ int epic_uart_read_str(char *buf, size_t cnt)
return
i
;
}
long
_write_epicardium
(
int
fd
,
const
char
*
buf
,
size_t
cnt
)
{
/*
* Only print one line at a time. Insert `\r` between lines so they are
* properly displayed on the serial console.
*/
size_t
i
,
last
=
0
;
for
(
i
=
0
;
i
<
cnt
;
i
++
)
{
if
(
buf
[
i
]
==
'\n'
)
{
epic_uart_write_str
(
&
buf
[
last
],
i
-
last
);
epic_uart_write_str
(
"
\r
"
,
1
);
last
=
i
;
}
}
epic_uart_write_str
(
&
buf
[
last
],
cnt
-
last
);
return
cnt
;
}
/* Interrupt handler needed for SDK UART implementation */
void
UART0_IRQHandler
(
void
)
{
...
...
This diff is collapsed.
Click to expand it.
rahix
@rahix
mentioned in issue
#80 (closed)
·
5 years ago
mentioned in issue
#80 (closed)
mentioned in issue #80
Toggle commit list
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