rust-embedded / cortex-m-semihosting

Semihosting for ARM Cortex-M processors
Apache License 2.0
40 stars 19 forks source link

WIP: proof of concept for stdout() and stderr() functions to open streams #11

Closed schodet closed 7 years ago

schodet commented 7 years ago

Here is a proof of concept made by following review in #7.

If this is ok, I think the next step is to remove all write functions and print macros and use the regular write! macro.

Tested with black magic probe.

schodet commented 7 years ago

I think we should also provide a fn write_all(&self, bytes: &[u8]) -> Result<(), ()> method on Stdout and Stderr for convenience.

Even if std is not built?

japaric commented 7 years ago

Even if std is not built?

We can provide write_all as an inherent method (i.e. impl Stdout { fn write_all(&mut self, ..) }). No need to use a trait (io::Write is not available in core anyway).