From 12e45d45bd11e4dd02a02b467e8b571b8ea410e9 Mon Sep 17 00:00:00 2001 From: Siddharth Kumar Jha Date: Sun, 27 Oct 2024 01:53:55 +0530 Subject: [PATCH] doc: fixing review comments --- arch/riscv/src/lib.rs | 18 +++++------------- capsules/extra/src/servo.rs | 4 +++- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/arch/riscv/src/lib.rs b/arch/riscv/src/lib.rs index 465272f821..a17bc1ff4a 100644 --- a/arch/riscv/src/lib.rs +++ b/arch/riscv/src/lib.rs @@ -10,18 +10,10 @@ pub mod csr; -#[cfg(all(target_arch = "riscv32", not(doc)))] -pub const XLEN: usize = 32; -#[cfg(all(target_arch = "riscv64", not(doc)))] -pub const XLEN: usize = 64; - // Default to 32 bit if no architecture is specified of if this is being // compiled for docs or testing on a different architecture. -#[cfg(any( - doc, - not(all( - any(target_arch = "riscv32", target_arch = "riscv64"), - target_os = "none" - )) -))] -pub const XLEN: usize = 32; +pub const XLEN: usize = if cfg!(target_arch = "riscv64") { + 64 +} else { + 32 +}; diff --git a/capsules/extra/src/servo.rs b/capsules/extra/src/servo.rs index d8add09a4c..62f703a872 100644 --- a/capsules/extra/src/servo.rs +++ b/capsules/extra/src/servo.rs @@ -7,6 +7,7 @@ //! Usage //! ----- //! +//! ```ignore //! use kernel::static_init; //! let mux_pwm = components::pwm::PwmMuxComponent::new(&peripherals.pwm) //! .finalize(components::pwm_mux_component_static!(rp2040::pwm::Pwm)); @@ -19,7 +20,7 @@ //! capsules_extra::sg90::Sg90< //! 'static, //! capsules_core::virtualizers::virtual_pwm::PwmPinUser<'static, rp2040::pwm::Pwm>, -//! \>, +//! >, //! capsules_extra::sg90::Sg90::new(virtual_pwm_servo) //! ); //! @@ -32,6 +33,7 @@ //! capsules_extra::servo::Servo<'static, 2>, //! capsules_extra::servo::Servo::new(multi_servo) //! ); +//! ``` use kernel::hil; use kernel::syscall::{CommandReturn, SyscallDriver};