exceptions chapter is confusing

Open
#152 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust

Research direction

Start with the exceptions chapter at https://rust-embedded.github.io/book/start/exceptions.html#exceptions and read the quoted passages in context. Clarify the distinction between hardware exceptions, interrupts, compilation errors, and the safety of static mut variables in exception handlers. Done means the chapter's flow and conclusion are understandable to readers coming from a software background.

Written by the indexing model from the issue text.

Description

https://rust-embedded.github.io/book/start/exceptions.html#exceptions

Exceptions, and interrupts, are a hardware mechanism -> thus exceptions are a hardware mechanism. When coming from a software background exception are only known as language construct. This can use some more clarification. Also the explanation of interrupts as well.

Following the previous example, the statement SysTick(); would result in a compilation error.

This behavior is pretty much intended and it's required to provide a feature: static mut variables declared inside exception handlers are safe to use.

How can it be safe when you get a compilation error? Explain safe.

Yet I just told that exception handlers can safely use static mut variables.

don't know about that, as far as i know you get a compilation error. Don't understand the flow of the text and it's conclusion here

Dominant language
No language data
Stars
1.3k
Forks
223
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-embedded/book

All issues in rust-embedded/book

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.