Skip to content

Commit 181e667

Browse files
shuejaAfoHT
authored andcommitted
Fix algorithm typo in preface.md
1 parent 300ad99 commit 181e667

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

book/en/src/preface.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ For the running example, a snapshot of the ARM Cortex M [Nested Vectored Interru
125125
A claim (lock(r)) will change the current system ceiling (𝜫) and can be implemented as a *named* critical section:
126126
- old_ceiling = 𝜫, 𝜫 = 𝝅(r)
127127
- execute code within critical section
128-
- old_ceiling = 𝜫
128+
- 𝜫 = old_ceiling
129129

130130
This amounts to a resource protection mechanism, requiring only two machine instructions on enter and one on exit the critical section, for managing the `BASEPRI` register. For architectures lacking `BASEPRI`, we can implement the system ceiling through a set of machine instructions for disabling/enabling interrupts on entry/exit for the named critical section. The number of machine instructions vary depending on the number of mask registers that needs to be updated (a single machine operation can operate on up to 32 interrupts, so for the M0/M0+ architecture a single instruction suffice). RTIC will determine the ceiling values and masking constants at compile time, thus all operations is in Rust terms zero-cost.
131131

0 commit comments

Comments
 (0)