Skip to content

Commit de67c31

Browse files
Add additional configuration section to docs in packages that lacked this (#3827)
* Add `additional configuration` to docs in packages that lacked this * update esp-backtrace doc * address review Co-authored-by: Dániel Buga <bugadani@gmail.com> * update the "greeting" entry * conditioned "force frame pointers" entry * oopsy --------- Co-authored-by: Dániel Buga <bugadani@gmail.com>
1 parent fc27f98 commit de67c31

File tree

4 files changed

+39
-4
lines changed

4 files changed

+39
-4
lines changed

esp-backtrace/Cargo.toml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ esp-config = { version = "0.5.0", path = "../esp-config" }
2525
esp-println = { version = "0.15.0", optional = true, default-features = false, path = "../esp-println" }
2626
heapless = "0.8"
2727
semihosting = { version = "0.1.20", optional = true }
28+
document-features = "0.2.11"
2829

2930
[build-dependencies]
3031
esp-config = { version = "0.5.0", path = "../esp-config", features = ["build"] }
@@ -40,21 +41,27 @@ esp32h2 = ["esp-println?/esp32h2"]
4041
esp32s2 = ["esp-println?/esp32s2", "semihosting?/openocd-semihosting"]
4142
esp32s3 = ["esp-println?/esp32s3", "semihosting?/openocd-semihosting", "print-float-registers"]
4243

43-
# Use esp-println
44+
## Use `esp-println`
4445
println = ["dep:esp-println"]
4546

46-
# Use defmt
47+
## Use `defmt`
4748
defmt = ["dep:defmt"]
4849

4950
print-float-registers = [] # TODO support esp32p4
5051

5152
# You may optionally enable one or more of the below features to provide
5253
# additional functionality:
54+
## Print messages in red (only used for panic and exception handlers)
5355
colors = []
56+
## Invoke the extern function custom_halt() instead of doing a loop {} in case of a panic or exception
5457
custom-halt = []
58+
## Invoke the extern function `custom_pre_backtrace()` before handling a panic or exception
5559
custom-pre-backtrace = []
60+
## Include an exception handler, will add `esp-println` as a dependency
5661
exception-handler = []
62+
## Halt both CPUs on ESP32 / ESP32-S3 instead of doing a `loop {}` in case of a panic or exception
5763
halt-cores = []
64+
## Include a panic handler, will add `esp-println` as a dependency
5865
panic-handler = []
5966

6067
[lints.rust]

esp-backtrace/src/lib.rs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
#![allow(rustdoc::bare_urls, unused_macros)]
22
#![cfg_attr(target_arch = "xtensa", feature(asm_experimental_arch))]
3-
#![doc = include_str!("../README.md")]
3+
//! This is a lightweight crate for obtaining backtraces during panics, exceptions, and hard faults
4+
//! on Espressif devices. It provides optional panic and exception handlers and supports a range of
5+
//! output options, all configurable through feature flags.
6+
#![cfg_attr(
7+
target_arch = "riscv32",
8+
doc = "Please note that you **need** to force frame pointers (i.e. `\"-C\", \"force-frame-pointers\",` in your `.cargo/config.toml`)"
9+
)]
10+
//! You can get an array of backtrace addresses (limited to 10 entries by default) via
11+
//! `arch::backtrace()` if you want to create a backtrace yourself (i.e. not using the panic or
12+
//! exception handler).
13+
//!
14+
//! ## Features
15+
#![doc = document_features::document_features!()]
16+
//! ## Additional configuration
17+
//!
18+
//! We've exposed some configuration options that don't fit into cargo
19+
//! features. These can be set via environment variables, or via cargo's `[env]`
20+
//! section inside `.cargo/config.toml`. Below is a table of tunable parameters
21+
//! for this crate:
22+
#![doc = ""]
23+
#![doc = include_str!(concat!(env!("OUT_DIR"), "/esp_backtrace_config_table.md"))]
424
#![doc(html_logo_url = "https://avatars.githubusercontent.com/u/46717278")]
525
#![no_std]
626

esp-hal-embassy/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
//! queue flavour, then you need to pass as many timers as you start executors.
3636
//! In other cases, you can pass a single timer.
3737
//!
38-
//! ## Configuration
38+
//! ## Additional Configuration
3939
//!
4040
//! You can configure the behaviour of the embassy runtime by using the
4141
//! following environment variables:

esp-ieee802154/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717
//!
1818
//! ## Feature Flags
1919
#![doc = document_features::document_features!()]
20+
//! ## Additional configuration
21+
//!
22+
//! We've exposed some configuration options that don't fit into cargo
23+
//! features. These can be set via environment variables, or via cargo's `[env]`
24+
//! section inside `.cargo/config.toml`. Below is a table of tunable parameters
25+
//! for this crate:
26+
#![doc = ""]
27+
#![doc = include_str!(concat!(env!("OUT_DIR"), "/esp_ieee802154_config_table.md"))]
2028
#![doc(html_logo_url = "https://avatars.githubusercontent.com/u/46717278")]
2129
#![no_std]
2230

0 commit comments

Comments
 (0)