diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/lpc55s69/Cargo.toml | 4 | ||||
| -rw-r--r-- | examples/lpc55s69/src/bin/log_to_defmt.rs | 18 |
2 files changed, 22 insertions, 0 deletions
diff --git a/examples/lpc55s69/Cargo.toml b/examples/lpc55s69/Cargo.toml index 6ec6e51a8..7e3b82432 100644 --- a/examples/lpc55s69/Cargo.toml +++ b/examples/lpc55s69/Cargo.toml | |||
| @@ -18,5 +18,9 @@ defmt-rtt = "1.0.0" | |||
| 18 | panic-probe = { version = "1.0.0", features = ["print-defmt"] } | 18 | panic-probe = { version = "1.0.0", features = ["print-defmt"] } |
| 19 | panic-semihosting = "0.6.0" | 19 | panic-semihosting = "0.6.0" |
| 20 | 20 | ||
| 21 | [features] | ||
| 22 | ## To test all-logs mode | ||
| 23 | log-to-defmt = ["embassy-nxp/log-to-defmt"] | ||
| 24 | |||
| 21 | [profile.release] | 25 | [profile.release] |
| 22 | debug = 2 | 26 | debug = 2 |
diff --git a/examples/lpc55s69/src/bin/log_to_defmt.rs b/examples/lpc55s69/src/bin/log_to_defmt.rs new file mode 100644 index 000000000..7aaab5e54 --- /dev/null +++ b/examples/lpc55s69/src/bin/log_to_defmt.rs | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | /// To test log-to-defmt feature, you have to run the binary file with the corresponding flag | ||
| 2 | /// Example: cargo run --bin <file> --feature log-to-defmt | ||
| 3 | |||
| 4 | |||
| 5 | #![no_std] | ||
| 6 | #![no_main] | ||
| 7 | |||
| 8 | use log::*; | ||
| 9 | use embassy_executor::Spawner; | ||
| 10 | use {defmt_rtt as _, panic_halt as _}; | ||
| 11 | |||
| 12 | #[embassy_executor::main] | ||
| 13 | async fn main(_spawner: Spawner) { | ||
| 14 | info!("Hello World"); | ||
| 15 | loop{ | ||
| 16 | info!("Another test"); | ||
| 17 | } | ||
| 18 | } | ||
