From a5f4ebee56556beab08fc3e25d0b5a0818619cb7 Mon Sep 17 00:00:00 2001 From: Mirabellensaft Date: Tue, 21 Mar 2023 18:43:42 +0100 Subject: [PATCH] address issues --- embedded-workshop-book/src/generating-pac.md | 2 +- embedded-workshop-book/src/pac-docs.md | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/embedded-workshop-book/src/generating-pac.md b/embedded-workshop-book/src/generating-pac.md index a46d20f..936fb02 100644 --- a/embedded-workshop-book/src/generating-pac.md +++ b/embedded-workshop-book/src/generating-pac.md @@ -15,8 +15,8 @@ Generate your own PAC from an SVD file. * Install `svd2rust` and `form` via cargo. * Download the [nrf-svd][svd] file and place it into `down-the-stack/dk-pac`. * Run `svd2rust` on the file using the `cortex-m` target. -* Format the generated file to make it readable. * Split the file into its modules using `form`. +* Format the generated file to make it readable. * Check the documentation. ## Step-by-Step Solution diff --git a/embedded-workshop-book/src/pac-docs.md b/embedded-workshop-book/src/pac-docs.md index eebb896..f3b9182 100644 --- a/embedded-workshop-book/src/pac-docs.md +++ b/embedded-workshop-book/src/pac-docs.md @@ -35,6 +35,12 @@ Note the difference between the struct field `UARTE0` in `Peripherals` and the m * `dk_pac/src/lib.rs` defines the singleton peripherals as part of a larger `struct Peripherals`. There are two methods for this struct: `take()` and `steal()`. `take()` assures, that only one instance of this can exist. Hence, it's safe. Note that `take()` is only available with the `critical-section` feature enabled. +To generate documentation that includes `take()`, pass the `critical-section` feature flag when generating the docs: + +``` +cargo doc --open --features critical-section +``` + * `dk_pac/src/uarte0.rs` defines a struct that contains all the registers of the `UARTE0` peripheral. The `enable` field represents the register of the same name. * `dk_pac/src/uarte0/enable.rs` defines the types associated with this register that you already saw in the docs.