diff options
| author | sodo <[email protected]> | 2024-01-02 01:37:00 +0900 |
|---|---|---|
| committer | sodo <[email protected]> | 2024-01-02 13:34:22 +0900 |
| commit | 6ee153a3e2eec284c0d9d87f31801265c0604f74 (patch) | |
| tree | 8b801cbd15f9ad5052d5942c731e75736dc9d7eb /embassy-net/src/lib.rs | |
| parent | b7cd7952c890f585ff876c622482534e5d58d4a4 (diff) | |
| parent | 0be9b0599aaf2e425d76ec7852ff4b3535defddf (diff) | |
Merge remote-tracking branch 'origin'
Diffstat (limited to 'embassy-net/src/lib.rs')
| -rw-r--r-- | embassy-net/src/lib.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/embassy-net/src/lib.rs b/embassy-net/src/lib.rs index bf1468642..2cef2232c 100644 --- a/embassy-net/src/lib.rs +++ b/embassy-net/src/lib.rs | |||
| @@ -5,6 +5,9 @@ | |||
| 5 | #![warn(missing_docs)] | 5 | #![warn(missing_docs)] |
| 6 | #![doc = include_str!("../README.md")] | 6 | #![doc = include_str!("../README.md")] |
| 7 | 7 | ||
| 8 | //! ## Feature flags | ||
| 9 | #![doc = document_features::document_features!(feature_label = r#"<span class="stab portability"><code>{feature}</code></span>"#)] | ||
| 10 | |||
| 8 | #[cfg(not(any(feature = "proto-ipv4", feature = "proto-ipv6")))] | 11 | #[cfg(not(any(feature = "proto-ipv4", feature = "proto-ipv6")))] |
| 9 | compile_error!("You must enable at least one of the following features: proto-ipv4, proto-ipv6"); | 12 | compile_error!("You must enable at least one of the following features: proto-ipv4, proto-ipv6"); |
| 10 | 13 | ||
| @@ -411,10 +414,12 @@ impl<D: Driver> Stack<D> { | |||
| 411 | /// ```ignore | 414 | /// ```ignore |
| 412 | /// let config = embassy_net::Config::dhcpv4(Default::default()); | 415 | /// let config = embassy_net::Config::dhcpv4(Default::default()); |
| 413 | ///// Init network stack | 416 | ///// Init network stack |
| 414 | /// let stack = &*make_static!(embassy_net::Stack::new( | 417 | /// static RESOURCES: StaticCell<embassy_net::StackResources<2> = StaticCell::new(); |
| 418 | /// static STACK: StaticCell<embassy_net::Stack> = StaticCell::new(); | ||
| 419 | /// let stack = &*STACK.init(embassy_net::Stack::new( | ||
| 415 | /// device, | 420 | /// device, |
| 416 | /// config, | 421 | /// config, |
| 417 | /// make_static!(embassy_net::StackResources::<2>::new()), | 422 | /// RESOURCES.init(embassy_net::StackResources::new()), |
| 418 | /// seed | 423 | /// seed |
| 419 | /// )); | 424 | /// )); |
| 420 | /// // Launch network task that runs `stack.run().await` | 425 | /// // Launch network task that runs `stack.run().await` |
