Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display a warning banner linking to docs.esp-rs.org when documentation is hosted on docs.rs #1266

Merged
merged 2 commits into from
Mar 12, 2024
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
5 changes: 5 additions & 0 deletions esp-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ repository = "https://github.com/esp-rs/esp-hal"
license = "MIT OR Apache-2.0"
links = "esp-hal"

[package.metadata.docs.rs]
default-target = "riscv32imac-unknown-none-elf"
features = ["eh1", "esp32c6"]
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
bitflags = "2.4.2"
bitfield = "0.14.0"
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/etm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! a particular Event to a particular Task. When an event is activated, the ETM
//! channel will trigger the corresponding task automatically.
//!
//! More information: https://docs.espressif.com/projects/esp-idf/en/latest/esp32c6/api-reference/peripherals/etm.html
//! More information: <https://docs.espressif.com/projects/esp-idf/en/latest/esp32c6/api-reference/peripherals/etm.html>
//!
//! ## Example
//! ```no_run
Expand Down
11 changes: 8 additions & 3 deletions esp-hal/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
//! `no_std` HAL implementations for the peripherals which are common among
//! Espressif devices. Implements a number of the traits defined by
//! [embedded-hal].
#![cfg_attr(
docsrs,
doc = "<div style='padding:30px;background:#810;color:#fff;text-align:center;'><p>You might want to <a href='https://docs.esp-rs.org/esp-hal/'>browse the <code>esp-hal</code> documentation on the esp-rs website</a> instead.</p><p>The documentation here on <a href='https://docs.rs'>docs.rs</a> is built for a single chip only (ESP32-C6, in particular), while on the esp-rs website you can select your exact chip from the list of supported devices. Available peripherals and their APIs change depending on the chip.</p></div>\n\n<br/>\n\n"
)]
//! Bare-metal (`no_std`) HAL for Espressif devices. Implements most of the
//! traits defined by various packages in the [embedded-hal] repository.
//!
//! [embedded-hal]: https://github.com/rust-embedded/embedded-hal
//!
//! ## Feature Flags
#![doc = document_features::document_features!()]
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/soc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl self::efuse::Efuse {
/// The new value will be returned by `read_mac_address` instead of the one
/// hard-coded in eFuse. This does not persist across device resets.
///
/// Can only be called once. Returns `Err(`[`SetMacError::AlreadySet`]`)`
/// Can only be called once. Returns `Err(SetMacError::AlreadySet)`
/// otherwise.
pub fn set_mac_address(mac: [u8; 6]) -> Result<(), SetMacError> {
if MAC_OVERRIDE_STATE
Expand Down
Loading