Skip to content

Commit 4e585ca

Browse files
bugadaniMabezDev
andauthored
Further tweak esp-radio docs (#4297)
* Further tweak esp-radio docs * Update esp-radio/src/lib.rs Co-authored-by: Scott Mabin <[email protected]> --------- Co-authored-by: Scott Mabin <[email protected]>
1 parent 7eabbe4 commit 4e585ca

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

esp-radio/src/lib.rs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,19 @@
2424
//!
2525
//! Ensure that the right features are enabled for your chip. See [Examples](https://github.com/esp-rs/esp-hal/tree/main/examples#examples) for more examples.
2626
//!
27+
//! You will also need a dynamic memory allocator, and a preemptive task scheduler in your
28+
//! application. For the dynamic allocator, we recommend using `esp-alloc`. For the task scheduler,
29+
//! the simplest option that is supported by us is `esp-rtos`, but you may use Ariel
30+
//! OS or other operating systems as well.
31+
//!
2732
//! ```toml
2833
//! [dependencies.esp-radio]
2934
//! # A supported chip needs to be specified, as well as specific use-case features
30-
#![doc = concat!(r#"features = [""#, chip!(), r#"", "wifi", "esp-now"]"#)]
35+
#![doc = concat!(r#"features = [""#, chip!(), r#"", "wifi", "esp-now", "esp-alloc"]"#)]
36+
//! [dependencies.esp-rtos]
37+
#![doc = concat!(r#"features = [""#, chip!(), r#"", "esp-radio", "esp-alloc"]"#)]
38+
//! [dependencies.esp-alloc]
39+
#![doc = concat!(r#"features = [""#, chip!(), r#""]"#)]
3140
//! ```
3241
//!
3342
//! ### Optimization Level
@@ -57,7 +66,7 @@
5766
//! Please note that the configuration keys are usually named slightly different and not all configuration keys apply.
5867
#![cfg_attr(
5968
feature = "wifi",
60-
doc = "By default the power-saving mode is [PowerSaveMode::None](crate::wifi::PowerSaveMode::None) and `ESP_PHY_PHY_ENABLE_USB` is enabled by default."
69+
doc = "By default the power-saving mode is [`PowerSaveMode::None`](crate::wifi::PowerSaveMode::None) and `ESP_PHY_CONFIG_PHY_ENABLE_USB` is enabled by default."
6170
)]
6271
//! In addition pay attention to these configuration keys:
6372
//! - `ESP_RADIO_RX_QUEUE_SIZE`
@@ -70,18 +79,16 @@
7079
"\n\n",
7180
"BLE and Wi-Fi can also be run on the second core.",
7281
"\n\n",
73-
"`esp_rtos::init` and `esp_radio::init` _must_ be called on the core on",
74-
"which you intend to run the wireless code. This will correctly initialize",
75-
"the radio peripheral to run on that core, and ensure that interrupts are",
76-
"serviced by the correct core.",
82+
"`esp_radio::init` is recommended to be called on the first core. The tasks ",
83+
"created by `esp-radio` are pinned to the first core.",
7784
"\n\n",
78-
"It's also important to allocate adequate stack for the second core; in many",
79-
"cases 8kB is not enough, and 16kB or more may be required depending on your",
80-
"use case. Failing to allocate adequate stack may result in strange behaviour,",
85+
"It's also important to allocate adequate stack for the second core; in many ",
86+
"cases 8kB is not enough, and 16kB or more may be required depending on your ",
87+
"use case. Failing to allocate adequate stack may result in strange behaviour, ",
8188
"such as your application silently failing at some point during execution."
8289
)
8390
)]
84-
//! # Features flags
91+
//! ## Feature flags
8592
//!
8693
//! Note that not all features are available on every MCU. For example, `ble`
8794
//! (and thus, `coex`) is not available on ESP32-S2.

0 commit comments

Comments
 (0)