rust-embedded / book

Documentation on how to use the Rust Programming Language to develop firmware for bare metal (microcontroller) devices
https://docs.rust-embedded.org/book/
Apache License 2.0
1.12k stars 177 forks source link

Example of how to conditionally include semihosting #111

Closed rubberduck203 closed 5 years ago

rubberduck203 commented 5 years ago

The book mentions several times

When using real hardware [don't do this]

but makes no mention of how to configure the build so that we can leave the code in, but conditionally compile it in only when we wish to run in an emulator or with a debugger attached. It would be very useful to have an example of how to accomplish this without modifying the code.

rubberduck203 commented 5 years ago

There's an example right here, in a round about way. https://rust-embedded.github.io/book/start/panicking.html