From ef24c9fe1e63f0c3a06b4832f7dd0bc6b390e571 Mon Sep 17 00:00:00 2001 From: DongQing Date: Tue, 24 Sep 2024 21:38:19 +0800 Subject: [PATCH] [board] small fix and code cleanup for 100ask-d1-h-rs Signed-off-by: DongQing --- Cargo.lock | 36 +++++++++++++++++++++++ Cargo.toml | 6 +++- board/100ask-d1-h-rs/src/bin/init-dram.rs | 2 +- board/100ask-d1-h-rs/src/lib.rs | 2 +- 4 files changed, 43 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 31865559..a93e39c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -230,6 +230,16 @@ version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "log" version = "0.4.22" @@ -438,6 +448,21 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + [[package]] name = "strsim" version = "0.10.0" @@ -476,6 +501,17 @@ dependencies = [ "embedded-io", "naked-function", "panic-halt", + "spin", + "syterkit-macros", +] + +[[package]] +name = "syterkit-macros" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 1fdaa329..197b15c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,8 @@ [workspace] resolver = "2" -members = ["board/100ask-d1-h-rs", "board/100ask-d1-h-rs/xtask"] +members = [ + "board/100ask-d1-h-rs", + "board/100ask-d1-h-rs/macros", + "board/100ask-d1-h-rs/xtask", +] default-members = ["board/100ask-d1-h-rs/xtask"] diff --git a/board/100ask-d1-h-rs/src/bin/init-dram.rs b/board/100ask-d1-h-rs/src/bin/init-dram.rs index 2e860750..0066a745 100644 --- a/board/100ask-d1-h-rs/src/bin/init-dram.rs +++ b/board/100ask-d1-h-rs/src/bin/init-dram.rs @@ -1,7 +1,7 @@ #![no_std] #![no_main] use panic_halt as _; -use syterkit_100ask_d1_h::{mctl, println, entry, Clocks, Peripherals}; +use syterkit_100ask_d1_h::{entry, mctl, println, Clocks, Peripherals}; #[entry] fn main(p: Peripherals, c: Clocks) { diff --git a/board/100ask-d1-h-rs/src/lib.rs b/board/100ask-d1-h-rs/src/lib.rs index 24ce7bea..3f74d104 100644 --- a/board/100ask-d1-h-rs/src/lib.rs +++ b/board/100ask-d1-h-rs/src/lib.rs @@ -79,7 +79,7 @@ macro_rules! print { #[macro_export] macro_rules! println { - () => ($crate::print!("\n")); + () => ($crate::print!("\r\n")); ($($arg:tt)*) => {{ $crate::_print(core::format_args!($($arg)*)); $crate::println!();