Skip to content

Commit

Permalink
Even friendlier error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mvirkkunen committed Aug 21, 2020
1 parent 3dcd446 commit 3d27596
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion panic-rtt-target/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,8 @@ fn panic(info: &PanicInfo) -> ! {
}

#[cfg(not(any(feature = "cortex-m")))]
compile_error!("You must specify a platform feature for panic-rtt-target, such as 'cortex-m'.");
compile_error!(concat!(
"You must specify a platform feature for panic-rtt-target, such as 'cortex-m'.\r\n",
"Example:\r\n",
" # Cargo.toml\r\n",
" panic-rtt-target = { version = \"x.y.z\", features = [\"cortex-m\"] }\r\n"));
4 changes: 2 additions & 2 deletions rtt-target/src/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ macro_rules! rtt_init_print {
($_:tt) => {
compile_error!(concat!(
"rtt_init_print! is only available if a platform support feature is enabled.\r\n",
"To fix:\r\n",
"Solutions:\r\n",
"- Enable a platform support feature:\r\n",
" # Cargo.toml\r\n",
" rtt-target = { version = \"x.y.z\", features = [\"cortex-m\"] }\r\n",
"- OR use set_print_channel_cs() if you want to provide your own locking.\r\n"))
"- OR use set_print_channel_cs() instead if you want to provide your own locking.\r\n"))
};
}

0 comments on commit 3d27596

Please sign in to comment.