veecle_osal_freertos/
log.rs1#[cfg(not(all(target_arch = "arm", target_os = "none")))]
4use std::io::Write;
5
6pub use veecle_osal_api::log::LogTarget;
7
8#[derive(Debug)]
10pub struct Log;
11
12impl LogTarget for Log {
13 type Time = crate::time::Time;
14
15 fn init() {
16 #[cfg(all(target_arch = "arm", target_os = "none"))]
17 rtt_target::rtt_init_print!();
18 }
19
20 fn println(args: core::fmt::Arguments<'_>) {
21 #[cfg(all(target_arch = "arm", target_os = "none"))]
23 rtt_target::rprintln!("{}", args);
26
27 #[cfg(not(all(target_arch = "arm", target_os = "none")))]
28 let _ = std::writeln!(std::io::stdout(), "{args}");
30 }
31}