aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/macros.rs
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2019-06-24 21:14:32 -0400
committerBrian Cully <bjc@kublai.com>2019-07-23 19:55:18 -0400
commit63d4ce8154eb8f6feb67986e98ea9b5007632460 (patch)
tree187e66104eb7c848dcf73a5ee067c5f27235360a /app/src/macros.rs
downloadsamd21-demo-63d4ce8154eb8f6feb67986e98ea9b5007632460.tar.gz
samd21-demo-63d4ce8154eb8f6feb67986e98ea9b5007632460.zip
Initial commit.
Diffstat (limited to 'app/src/macros.rs')
-rw-r--r--app/src/macros.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/app/src/macros.rs b/app/src/macros.rs
new file mode 100644
index 0000000..fe262b4
--- /dev/null
+++ b/app/src/macros.rs
@@ -0,0 +1,31 @@
+#[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);}
+ };
+ (_) => {};
+}
+
+#[macro_export]
+macro_rules! log_now {
+ ($($arg:tt)*) => {
+ unsafe {crate::log::write_fmt_now(format_args!($($arg)*), false);}
+ };
+ (_) => {};
+}