diff options
| author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-16 22:54:18 +0000 |
|---|---|---|
| committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-16 22:54:18 +0000 |
| commit | 77def324548e204d3a36a4e89eb528904c381158 (patch) | |
| tree | 98d6835a2048d96bbe4df0173731df82feee7c21 /book | |
| parent | e1e4c98cb900a1425b583edeb12cd3df7ff34ea1 (diff) | |
| parent | aa7eec02996aca9304187f36d674d5fe898aece6 (diff) | |
Merge #170
170: check task priority at compile time r=TeXitoi a=japaric
before we were checking the priority at runtime. The compile time error message
when the priority is too high is kind of awful though.
Co-authored-by: Jorge Aparicio <jorge@japaric.io>
Diffstat (limited to 'book')
| -rw-r--r-- | book/en/src/by-example/resources.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/book/en/src/by-example/resources.md b/book/en/src/by-example/resources.md index 46d04a7..17f4d13 100644 --- a/book/en/src/by-example/resources.md +++ b/book/en/src/by-example/resources.md @@ -69,6 +69,13 @@ the critical section created by the lowest priority handler. $ cargo run --example lock {{#include ../../../../ci/expected/lock.run}}``` +One more note about priorities: choosing a priority higher than what the device +supports (that is `1 << NVIC_PRIO_BITS`) will result in a compile error. Due to +limitations in the language the error is currently far from helpful: it will say +something along the lines of "evaluation of constant value failed" and the span +of the error will *not* point out to the problematic interrupt value -- we are +sorry about this! + ## Late resources Unlike normal `static` variables, which need to be assigned an initial value |
