Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Astro
rust-card10
Commits
e882db08
Verified
Commit
e882db08
authored
Aug 24, 2019
by
Kloenk
Browse files
add print! and println! macro to write to UART
parent
d8468cc5
Pipeline
#3294
failed with stage
in 60 minutes and 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
l0dable/src/uart.rs
View file @
e882db08
...
...
@@ -11,3 +11,20 @@ impl Write for Uart {
Ok
(())
}
}
#[macro_export]
macro_rules!
print
{
(
$
(
$arg:tt
)
*
)
=>
(
$crate
::
uart
::
_print
(
format_args!
(
$
(
$arg
)
*
)));
}
#[macro_export]
macro_rules!
println
{
()
=>
(
$crate
::
print!
(
"
\r
"
));
(
$
(
$arg:tt
)
*
)
=>
(
$crate
::
print!
(
"{}
\r
"
,
format_args!
(
$
(
$arg
)
*
)));
}
#[doc(hidden)]
pub
fn
_print
(
args
:
core
::
fmt
::
Arguments
)
{
use
core
::
fmt
::
Write
;
crate
::
UART
.write_fmt
(
args
);
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment