Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
- Other internal clippy fixes for `clippy::manual_div_ceil`, `clippy::nonminimal_bool` and
`clippy::needless_lifetimes`
- Update `svd-rs` to 0.14.11
- Added `#![cfg_attr(docsrs, feature(doc_auto_cfg))]` to the generated library code. This
adds a display of the feature gates in the documentation of the generated library

## [v0.35.0] - 2024-11-12

Expand Down
1 change: 1 addition & 0 deletions src/generate/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result<Toke
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![no_std]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
});
}

Expand Down
17 changes: 17 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,23 @@
//! v-trap = ["rt", "riscv-rt/v-trap"]
//! ```
//!
//! ## Generating documentation
//!
//! You can generate the documentation for the generated library using the following command:
//!
//! ```sh
//! RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc --all-features --open
//! ```
//!
//! It is recommended to add the following block in the `Cargo.toml` of the generated library
//! if you plan to host the library documentaion on `docs.rs`
//!
//! ```toml
//! [package.metadata.docs.rs]
//! all-features = true
//! rustdoc-args = ["--generate-link-to-definition"]
//! ```
//!
//! # Peripheral API
//!
//! To use a peripheral first you must get an *instance* of the peripheral. All the device
Expand Down
Loading