aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/macros.rs
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2019-07-24 17:35:24 -0400
committerBrian Cully <bjc@kublai.com>2019-07-24 17:35:24 -0400
commit87015d0256e5c3888681da6d469e515b58efbb5f (patch)
treedcab0ddbe85a09b988808ce00729bf1cdd3927c9 /app/src/macros.rs
parentcd47fb1f4887ea863b7e90d476a8366634ce9980 (diff)
downloadsamd21-demo-87015d0256e5c3888681da6d469e515b58efbb5f.tar.gz
samd21-demo-87015d0256e5c3888681da6d469e515b58efbb5f.zip
Use log crate instead of hand-rolled solution.
* Remove my logging macros except *_now variants, since those are still handy. * Move log flush into RTC handler. This probably belongs in a separate timer at some point. * Change all old log messages to log crate's macros, except the Panic and HardFault calls.
Diffstat (limited to 'app/src/macros.rs')
-rw-r--r--app/src/macros.rs20
1 files changed, 2 insertions, 18 deletions
diff --git a/app/src/macros.rs b/app/src/macros.rs
index fe262b4..46d2d07 100644
--- a/app/src/macros.rs
+++ b/app/src/macros.rs
@@ -1,23 +1,7 @@
#[macro_export]
-macro_rules! logln {
- ($($arg:tt)*) => {
- crate::log::write_fmt(format_args!($($arg)*), true);
- };
- (_) => {};
-}
-
-#[macro_export]
-macro_rules! log {
- ($($arg:tt)*) => {
- crate::log::write_fmt(format_args!($($arg)*), false);
- };
- (_) => {};
-}
-
-#[macro_export]
macro_rules! logln_now {
($($arg:tt)*) => {
- unsafe {crate::log::write_fmt_now(format_args!($($arg)*), true);}
+ unsafe {crate::logger::write_fmt_now(format_args!($($arg)*), true);}
};
(_) => {};
}
@@ -25,7 +9,7 @@ macro_rules! logln_now {
#[macro_export]
macro_rules! log_now {
($($arg:tt)*) => {
- unsafe {crate::log::write_fmt_now(format_args!($($arg)*), false);}
+ unsafe {crate::logger::write_fmt_now(format_args!($($arg)*), false);}
};
(_) => {};
}