360: Improved loop example docs to highlight that one cannot have empty lo… r=AfoHT a=korken89

…ops in idle

Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
This commit is contained in:
bors[bot] 2020-09-22 17:20:48 +00:00 committed by GitHub
commit 9a33457c82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,6 +77,9 @@ references that are safe to access.
The example below shows that `idle` runs after `init`. The example below shows that `idle` runs after `init`.
**Note:** The `loop {}` in idle cannot be empty as this will crash the microcontroller due to a bug
in LLVM which miss-optimizes empty loops to a `UDF` instruction in release mode.
``` rust ``` rust
{{#include ../../../../examples/idle.rs}} {{#include ../../../../examples/idle.rs}}
``` ```