Closed alexisvl closed 7 years ago
Crap, it has come to my attention that stable Rust does have volatile accessors. Fix incoming.
Fixed.
":tt"
should have zero byte at the end, because some debuggers don't check the size and read the file name as c string instead.
Good point.
This uses the OPEN semihosting syscall to open stdout/stderr properly instead of assuming their FDs and that they work.
pub fn open_streams()
is added to do this, and documented.static mut
is used for the stream FDs because Cortex-M0 Rust doesn't have atomic types;#[inline(never)]
accessors are used to force these to be accessed because stable Rust doesn't have volatile types.This should be merged after PR #6; it contains the same commit as both touch the same area of the code.