From 619ebf147cba80e854e832c6e6cafa94779d726c Mon Sep 17 00:00:00 2001 From: Astro Date: Fri, 1 May 2020 01:33:00 +0200 Subject: [PATCH] libsupport_zynq: move mod logger to libboard_zynq --- Cargo.lock | 2 +- experiments/src/main.rs | 2 +- libboard_zynq/Cargo.toml | 1 + libboard_zynq/src/lib.rs | 1 + {libsupport_zynq => libboard_zynq}/src/logger.rs | 2 +- libsupport_zynq/Cargo.toml | 1 - libsupport_zynq/src/lib.rs | 1 - 7 files changed, 5 insertions(+), 5 deletions(-) rename {libsupport_zynq => libboard_zynq}/src/logger.rs (93%) diff --git a/Cargo.lock b/Cargo.lock index 9c0d7a0..222de97 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -66,6 +66,7 @@ dependencies = [ "embedded-hal 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "libcortex_a9 0.0.0", "libregister 0.0.0", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "nb 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "smoltcp 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -98,7 +99,6 @@ dependencies = [ "libcortex_a9 0.0.0", "libregister 0.0.0", "linked_list_allocator 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "r0 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/experiments/src/main.rs b/experiments/src/main.rs index ccb98a7..6662e3d 100644 --- a/experiments/src/main.rs +++ b/experiments/src/main.rs @@ -34,7 +34,7 @@ pub fn main_core0() { // zynq::clocks::CpuClocks::enable_io(1_250_000_000); println!("\nzc706 main"); - libsupport_zynq::logger::init().unwrap(); + libboard_zynq::logger::init().unwrap(); log::set_max_level(log::LevelFilter::Trace); info!("Boot mode: {:?}", zynq::slcr::RegisterBlock::new().boot_mode.read().boot_mode_pins()); diff --git a/libboard_zynq/Cargo.toml b/libboard_zynq/Cargo.toml index 676069e..cc3e522 100644 --- a/libboard_zynq/Cargo.toml +++ b/libboard_zynq/Cargo.toml @@ -15,6 +15,7 @@ bit_field = "0.10" embedded-hal = "0.2" nb = "0.1" void = { version = "1", default-features = false } +log = "0.4" libregister = { path = "../libregister" } libcortex_a9 = { path = "../libcortex_a9" } diff --git a/libboard_zynq/src/lib.rs b/libboard_zynq/src/lib.rs index 9276c93..5627e0a 100644 --- a/libboard_zynq/src/lib.rs +++ b/libboard_zynq/src/lib.rs @@ -17,3 +17,4 @@ pub mod flash; pub mod dmac; pub mod time; pub mod timer; +pub mod logger; diff --git a/libsupport_zynq/src/logger.rs b/libboard_zynq/src/logger.rs similarity index 93% rename from libsupport_zynq/src/logger.rs rename to libboard_zynq/src/logger.rs index 48cd92d..0caf014 100644 --- a/libsupport_zynq/src/logger.rs +++ b/libboard_zynq/src/logger.rs @@ -1,6 +1,6 @@ //! A logger for the `log` crate -use libboard_zynq::{println, stdio, timer::GlobalTimer}; +use crate::{println, stdio, timer::GlobalTimer}; pub static LOGGER: Logger = Logger; diff --git a/libsupport_zynq/Cargo.toml b/libsupport_zynq/Cargo.toml index b36307a..8921ac7 100644 --- a/libsupport_zynq/Cargo.toml +++ b/libsupport_zynq/Cargo.toml @@ -12,7 +12,6 @@ target_cora_z7_10 = ["libboard_zynq/target_cora_z7_10"] [dependencies] r0 = "1" compiler_builtins = "0.1" -log = "0.4" linked_list_allocator = { version = "0.8", default-features = false } libregister = { path = "../libregister" } libcortex_a9 = { path = "../libcortex_a9" } diff --git a/libsupport_zynq/src/lib.rs b/libsupport_zynq/src/lib.rs index bd9faf6..c1e0a5e 100644 --- a/libsupport_zynq/src/lib.rs +++ b/libsupport_zynq/src/lib.rs @@ -10,5 +10,4 @@ pub extern crate compiler_builtins; pub mod boot; mod abort; mod panic; -pub mod logger; pub mod ram;