diff --git a/embedded-graphics-profiler-display/Cargo.toml b/embedded-graphics-profiler-display/Cargo.toml index 78754ca..f0b49d6 100644 --- a/embedded-graphics-profiler-display/Cargo.toml +++ b/embedded-graphics-profiler-display/Cargo.toml @@ -3,6 +3,9 @@ name = "embedded-graphics-profiler-display" version = "0.1.0" edition = "2021" +[features] +std = [] + [dependencies] atomic = "0.6.0" embassy-time = "0.3.2" diff --git a/embedded-graphics-profiler-display/src/lib.rs b/embedded-graphics-profiler-display/src/lib.rs index 42b896f..76270d8 100644 --- a/embedded-graphics-profiler-display/src/lib.rs +++ b/embedded-graphics-profiler-display/src/lib.rs @@ -1,4 +1,4 @@ -#![no_std] +#![cfg_attr(not(feature = "std"), no_std)] #![no_main] mod profiler; diff --git a/embedded-graphics-profiler-display/src/profiler/mod.rs b/embedded-graphics-profiler-display/src/profiler/mod.rs index d5715bc..39ee007 100644 --- a/embedded-graphics-profiler-display/src/profiler/mod.rs +++ b/embedded-graphics-profiler-display/src/profiler/mod.rs @@ -1,4 +1,7 @@ use atomic::Atomic; +#[cfg(feature = "std")] +use std::time::{Duration, Instant}; +#[cfg(not(feature = "std"))] use embassy_time::{Duration, Instant}; use embedded_graphics::draw_target::DrawTarget; use embedded_graphics::{Drawable, Pixel};