diff --git a/Cargo.toml b/Cargo.toml index 0679f97..c63b3d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,6 +28,7 @@ default = ["avr-std-stub"] all-mcus = [] [dependencies] +avr-config = "1.0" avr-std-stub = { version = "1.0", optional = true } const_env--value = "0.1" target-cpu-macro = "0.1" diff --git a/src/config.rs b/src/config.rs deleted file mode 100644 index bb7723f..0000000 --- a/src/config.rs +++ /dev/null @@ -1,13 +0,0 @@ -#[cfg(target_arch = "avr")] use const_env::value_from_env; - -/// The clock frequency of device being targeted in Hertz. -#[cfg(target_arch = "avr")] -pub const CPU_FREQUENCY_HZ: u32 = value_from_env!("AVR_CPU_FREQUENCY_HZ": u32); - -/// The clock frequency of device being targeted in Hertz. -/// -/// This value is arbitrarily set to 16MHz as this crate is currently being targeted for a non-AVR -/// device. -#[cfg(not(target_arch = "avr"))] -pub const CPU_FREQUENCY_HZ: u32 = 16_000_000; // Choose a nice default when not targeting AVR. - diff --git a/src/lib.rs b/src/lib.rs index b0a1c26..467e171 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,7 +24,7 @@ pub mod interrupt; pub mod modules; /// Configuration for the currently-targeted microcontroller. -pub mod config; +pub use avr_config as config; mod register; mod pin;