1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-24 23:31:56 +02:00

48 Commits

Author SHA1 Message Date
dependabot[bot]
16bafaf635
cargo: bump microbit-v2 from 0.14.0 to 0.15.0 in /src/bare-metal/microcontrollers/examples in the minor group (#2158)
Bumps the minor group in /src/bare-metal/microcontrollers/examples with
1 update: [microbit-v2](https://github.com/nrf-rs/microbit).

Updates `microbit-v2` from 0.14.0 to 0.15.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 10:20:20 +00:00
dependabot[bot]
a3f31e795d
cargo: bump nrf52833-hal from 0.17.1 to 0.18.0 in /src/bare-metal/microcontrollers/examples in the minor group (#2098)
Bumps the minor group in /src/bare-metal/microcontrollers/examples with
1 update: [nrf52833-hal](https://github.com/nrf-rs/nrf-hal).

Updates `nrf52833-hal` from 0.17.1 to 0.18.0
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/nrf-rs/nrf-hal/blob/master/CHANGELOG.md">nrf52833-hal's
changelog</a>.</em></p>
<blockquote>
<h2>[0.18.0]</h2>
<h3>Breaking changes</h3>
<ul>
<li>Updated <code>nrf-usbd</code> to 0.3.0. (<a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/460">#460</a>)</li>
</ul>
<h3>New features</h3>
<ul>
<li>Added support for nRF52805 (<a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/422">#422</a>).</li>
<li>Added implementation of RTIC <code>Monotonic</code> for RTC and
TIMER, behind new <code>monotonic</code> feature (<a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/427">#427</a>).</li>
</ul>
<p><a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/422">#422</a>:
<a
href="https://redirect.github.com/nrf-rs/nrf-hal/pull/422">nrf-rs/nrf-hal#422</a>
<a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/427">#427</a>:
<a
href="https://redirect.github.com/nrf-rs/nrf-hal/pull/427">nrf-rs/nrf-hal#427</a>
<a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/460">#460</a>:
<a
href="https://redirect.github.com/nrf-rs/nrf-hal/pull/440">nrf-rs/nrf-hal#440</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="997d0bd27a"><code>997d0bd</code></a>
Merge pull request <a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/476">#476</a>
from nrf-rs/release</li>
<li><a
href="bb7aef2593"><code>bb7aef2</code></a>
Prepare for 0.18.0 release.</li>
<li><a
href="090ce0ec9a"><code>090ce0e</code></a>
Merge pull request <a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/427">#427</a>
from Kyrne/master</li>
<li><a
href="4c00992a68"><code>4c00992</code></a>
Use consistent feature name.</li>
<li><a
href="eb8b34a73c"><code>eb8b34a</code></a>
Merge pull request <a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/477">#477</a>
from nrf-rs/buildfix</li>
<li><a
href="ee11451354"><code>ee11451</code></a>
rename user facing feature to rtic-monotonic</li>
<li><a
href="c8bf535d7b"><code>c8bf535</code></a>
Correct docs (<a
href="https://redirect.github.com/nrf-rs/nrf-hal/issues/18">#18</a>)</li>
<li><a
href="3c353da5f0"><code>3c353da</code></a>
Monotonic doesn't build on nrf51 or nrf52832 so remove the feature.</li>
<li><a
href="8eff0e5fc4"><code>8eff0e5</code></a>
Format doc comments and fix typos.</li>
<li><a
href="bb1bb77b30"><code>bb1bb77</code></a>
Fix feature conditions.</li>
<li>Additional commits viewable in <a
href="https://github.com/nrf-rs/nrf-hal/compare/v0.17.1...v0.18.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=nrf52833-hal&package-manager=cargo&previous-version=0.17.1&new-version=0.18.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-28 10:26:02 +01:00
Andrew Walbran
5ce6a9bd72
Downgrade cortex-m-rt to 0.7.3. (#2095)
0.7.4 was yanked.

Fixes #2094.
2024-05-23 15:14:05 -04:00
Andrew Walbran
45aa43f406
Update to embedded-hal 1.0 (#1723)
Now that the new version of `microbit-v2` and friends are finally
released, we can use `embedded-hal` 1.0 for the bare metal morning.
2024-04-19 12:52:50 +01:00
dependabot[bot]
0a1ddadc83
cargo: bump nrf52833-hal from 0.16.1 to 0.17.0 in /src/bare-metal/microcontrollers/examples in the minor group (#1989)
Bumps the minor group in /src/bare-metal/microcontrollers/examples with
1 update: [nrf52833-hal](https://github.com/nrf-rs/nrf-hal).

Updates `nrf52833-hal` from 0.16.1 to 0.17.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Walbran <qwandor@google.com>
2024-04-15 15:51:46 +00:00
Andrew Walbran
b808887006
Add safety comments and use consistent format for existing ones. (#1981)
We should have safety comments on all `unsafe` blocks, to set a good
example.
2024-04-12 13:19:19 -04:00
dependabot[bot]
dc597531fd
cargo: bump the patch group in /src/bare-metal/microcontrollers/examples with 1 update (#1912)
Bumps the patch group in /src/bare-metal/microcontrollers/examples with
1 update: [nrf52833-hal](https://github.com/nrf-rs/nrf-hal).

Updates `nrf52833-hal` from 0.16.0 to 0.16.1

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-11 10:27:03 +00:00
dependabot[bot]
00ece67120
cargo: bump embedded-hal from 0.2.7 to 1.0.0 in /src/bare-metal/microcontrollers/examples (#1721)
Bumps [embedded-hal](https://github.com/rust-embedded/embedded-hal) from
0.2.7 to 1.0.0.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-22 11:02:43 -08:00
dependabot[bot]
5ae1b33c75
cargo: bump the minor group in /src/bare-metal/microcontrollers/examples with 2 updates (#1719)
Bumps the minor group in /src/bare-metal/microcontrollers/examples with
2 updates: [nrf52833-hal](https://github.com/nrf-rs/nrf-hal) and
[nrf52833-pac](https://github.com/nrf-rs/nrf-pacs).

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-18 11:09:11 +00:00
Martin Geisler
c9f66fd425
Format all Markdown files with dprint (#1157)
This is the result of running `dprint fmt` after removing `src/` from
the list of excluded directories.

This also reformats the Rust code: we might want to tweak this a bit in
the future since some of the changes removes the hand-formatting. Of
course, this formatting can be seen as a mis-feature, so maybe this is
good overall.

Thanks to mdbook-i18n-helpers 0.2, the POT file is nearly unchanged
after this, meaning that all existing translations remain valid! A few
messages were changed because of stray whitespace characters:

     msgid ""
     "Slices always borrow from another object. In this example, `a` has to remain "
    -"'alive' (in scope) for at least as long as our slice. "
    +"'alive' (in scope) for at least as long as our slice."
     msgstr ""

The formatting is enforced in CI and we will have to see how annoying
this is in practice for the many contributors. If it becomes annoying,
we should look into fixing dprint/check#11 so that `dprint` can annotate
the lines that need fixing directly, then I think we can consider more
strict formatting checks.

I added more customization to `rustfmt.toml`. This is to better emulate
the dense style used in the course:

- `max_width = 85` allows lines to take up the full width available in
our code blocks (when taking margins and the line numbers into account).
- `wrap_comments = true` ensures that we don't show very long comments
in the code examples. I edited some comments to shorten them and avoid
unnecessary line breaks — please trim other unnecessarily long comments
when you see them! Remember we're writing code for slides 😄
- `use_small_heuristics = "Max"` allows for things like struct literals
and if-statements to take up the full line width configured above.

The formatting settings apply to all our Rust code right now — I think
we could improve this with https://github.com/dprint/dprint/issues/711
which lets us add per-directory `dprint` configuration files. However,
the `inherit: true` setting is not yet implemented (as far as I can
tell), so a nested configuration file will have to copy most or all of
the top-level file.
2023-12-31 00:15:07 +01:00
Martin Geisler
53baee82e3
Re-apply formatting to SUMMARY.md (#1429)
With the latest version of mdbook-i18n-helpers, we now have support for
formatting in the `SUMMARY.md` file. This allows us to revert the
changes made in #130 when we first introduced the translation support.

This also aligns a few headings to match the heading in the outline.
While this isn’t strictly necessary, it removes a bit of work for the
translators.
2023-12-01 13:20:28 -05:00
Oscar
b037548923
Add mdbook-xgettext skip for untranslatable codeblocks in Bare Metal (#1339)
See #1327

Removes 280 lines from `messages.pot`.

Signed-off-by: 0scvr <71343264+0scvr@users.noreply.github.com>
2023-10-11 09:32:12 +00:00
James Abley
2f50e8be84
Update debugging.md gdb command (#1332)
The provided example did not work for me. I got:

`zsh: command not found: gdb-multiarch`

The other version worked instead. This might be a MacOS thing, or an
Apple Silicon thing. The other command is the same as used in
https://docs.rust-embedded.org/book/intro/install/macos.html so maybe
the MacOS installation guidance also needs updating?
2023-10-10 10:32:31 +01:00
Hidenori Kobayashi
8ff97f1ee7
Remove HTML tag <abbr> (#1310)
The html tag seems to confuse the mdbook-i18n-helpers and make the
translation work hard (#1284).

This simply replaces them with a set of parenthesis.
2023-10-06 10:38:48 +01:00
Martin Geisler
9f079f173b
Update all Cargo.lock files (#1295)
This is the result of running `cargo update` in every directory.

It fixes a alert: https://github.com/advisories/GHSA-9mcr-873m-xcxp. We
don’t run any HTTP server directly, so this is not super important for
us. However, it will remove the alert from my dashboard.
2023-10-03 14:18:44 +02:00
Matthew
1c43db108b
Fix inconsistent filename styling (#1274)
Addresses https://github.com/google/comprehensive-rust/issues/625

Pages with inconsistent styling:
[Bare Metal Rust Afternoon
Solutions](https://google.github.io/comprehensive-rust/exercises/bare-metal/solutions-afternoon.html)
[Concurrency Afternoon
Solutions](https://google.github.io/comprehensive-rust/exercises/concurrency/solutions-afternoon.html)
[Microcontroller > Debugging
Page](https://google.github.io/comprehensive-rust/bare-metal/microcontrollers/debugging.html)
2023-09-29 08:38:42 +02:00
c6c7
5e72cf5687
Bump proc-macro2 from 1.0.50 to 1.0.66 in /src/bare-metal/microcontro… (#1160)
…llers/examples

The proc-macro2 dependency at 1.0.50 results in a build error mentioning
an unknown feature `proc_macro_span_shrink` that no longer exists in
nightly. Per https://github.com/rust-lang/rust/issues/113152, updating
proc-macro2 to the latest version fixes the error.

The build error I saw before updating the proc-macro2 dependency was the
following:

```
> cargo build --bin minimal
   Compiling proc-macro2 v1.0.50
   Compiling bare-metal v0.2.5
   Compiling typenum v1.16.0
   Compiling nrf52833-hal v0.14.1
error[E0635]: unknown feature `proc_macro_span_shrink`
  --> /home/chcl/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.50/src/lib.rs:92:30
   |
92 |     feature(proc_macro_span, proc_macro_span_shrink)
   |                              ^^^^^^^^^^^^^^^^^^^^^^

   Compiling cortex-m v0.7.7
For more information about this error, try `rustc --explain E0635`.
error: could not compile `proc-macro2` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
```
2023-09-04 11:50:12 +01:00
Andrew Walbran
87f1976589
cargo fmt with imports_granularity = "module" (#564) 2023-04-16 20:57:59 +02:00
Martin Geisler
907608c504
Format title consistently (#526) 2023-04-04 17:29:33 +02:00
Andrew Walbran
9c166d4e97 Set publish = false in examples and exercises. 2023-03-23 15:12:23 +00:00
Andrew Walbran
3b02b09901 Fix line numbers in debugging example. 2023-03-20 14:44:43 +00:00
dependabot[bot]
4f9b354019
Bump cortex-m-rt from 0.7.2 to 0.7.3 in /src/bare-metal/microcontrollers/examples (#516)
Bump cortex-m-rt in /src/bare-metal/microcontrollers/examples

Bumps [cortex-m-rt](https://github.com/rust-embedded/cortex-m) from 0.7.2 to 0.7.3.
- [Release notes](https://github.com/rust-embedded/cortex-m/releases)
- [Changelog](https://github.com/rust-embedded/cortex-m/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-embedded/cortex-m/compare/v0.7.2...v0.7.3)

---
updated-dependencies:
- dependency-name: cortex-m-rt
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-20 14:44:25 +00:00
Andrew Walbran
fe32d06862 Note where commands should be run. 2023-03-20 14:26:57 +00:00
Andrew Walbran
ecbb7e41bb Format imports with imports_granularity = "Module". 2023-03-20 14:26:57 +00:00
Andrew Walbran
94eafee6bb Add more notes. 2023-03-20 14:26:57 +00:00
Andrew Walbran
17bbf5f0b7 Explain how to run other examples too. 2023-03-20 14:26:57 +00:00
Andrew Walbran
53223d3581 Add page about debugging with cargo-embed. 2023-03-20 14:26:57 +00:00
Andrew Walbran
0c3664bef3 Add slide about probe-rs and cargo-embed. 2023-03-20 14:26:57 +00:00
Andrew Walbran
b1fa8da341 Wrap comments in example at 80 columns to fit in code block. 2023-03-20 14:26:57 +00:00
Andrew Walbran
e751c30061 Add minimal microcontroller example. 2023-03-20 14:26:57 +00:00
Andrew Walbran
6490657dcf Need to specify linker script for examples. 2023-03-20 14:26:57 +00:00
Andrew Walbran
2d64edf0d6 Explain a bit about example and how to run it. 2023-03-20 14:26:57 +00:00
Andrew Walbran
84cd822080 Speaker notes about TockOS and FreeRTOS. 2023-03-20 14:26:57 +00:00
Andrew Walbran
e123c08b00 Mention FreeRTOS bindings and Hubris. 2023-03-20 14:26:57 +00:00
Andrew Walbran
0fa73286b9 Add raw MMIO example. 2023-03-20 14:26:57 +00:00
Andrew Walbran
2545e40d21 Note use of embedded_hal trait. 2023-03-20 14:26:57 +00:00
Andrew Walbran
16b8efefa2 Add config for cargo-embed. 2023-03-20 14:26:57 +00:00
Andrew Walbran
2c8eb761c4 Use micro:bit v2 for PAC and HAL examples too. 2023-03-20 14:26:57 +00:00
Andrew Walbran
5ad0a593f8 Add board support crate example. 2023-03-20 14:26:57 +00:00
Andrew Walbran
b8b387c504 Mention board support crates and other tools. 2023-03-20 14:26:57 +00:00
Andrew Walbran
e21a83d5e8 Start or temperature logger exercise. 2023-03-20 14:26:57 +00:00
Andrew Walbran
5e0f4da4b3 Mention some other projects. 2023-03-20 14:26:57 +00:00
Andrew Walbran
baf81ee795 Note some supported devices. 2023-03-20 14:26:57 +00:00
Andrew Walbran
ac046661bf Exclude imports and other boilerplate from page.
It was getting too long.
2023-03-20 14:26:57 +00:00
Andrew Walbran
100341aa9f Add page about type-state pattern. 2023-03-20 14:26:57 +00:00
Andrew Walbran
65749777c9 Write about embedded-hal 2023-03-20 14:26:57 +00:00
Andrew Walbran
d507096d31 Mention svd2rust. 2023-03-20 14:26:57 +00:00
Andrew Walbran
f8f6922b0c Add pages with PAC and HAL examples. 2023-03-20 14:26:57 +00:00