Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Commit

Permalink
Add no-op feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ferris committed Nov 18, 2022
1 parent aa98995 commit bc7c842
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ esp8266 = []
uart = []
jtag_serial = [] # C3, C6, H2, and S3 only!
rtt = []
no-op = []
21 changes: 21 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
#![no_std]


#[cfg(feature = "no-op")]
#[macro_export]
macro_rules! println {
($($arg:tt)*) => {
{
}
};
}

#[cfg(feature = "no-op")]
#[macro_export]
macro_rules! print {
($($arg:tt)*) => {
{
}
};
}

#[cfg(not(feature = "no-op"))]
#[macro_export]
macro_rules! println {
($($arg:tt)*) => {
Expand All @@ -10,6 +30,7 @@ macro_rules! println {
};
}

#[cfg(not(feature = "no-op"))]
#[macro_export]
macro_rules! print {
($($arg:tt)*) => {
Expand Down

0 comments on commit bc7c842

Please sign in to comment.