From e167af01f02bfa0fbec8f51c54f1aee58ce1875d Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sat, 23 Feb 2019 22:21:30 +0100 Subject: [PATCH] document the `binds` feature cc @burrbull --- book/en/src/by-example/tips.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/book/en/src/by-example/tips.md b/book/en/src/by-example/tips.md index 8f71599a06..c0bfc56e14 100644 --- a/book/en/src/by-example/tips.md +++ b/book/en/src/by-example/tips.md @@ -75,3 +75,19 @@ $ cargo nm --example ramfunc --release | grep ' foo::' ``` console $ cargo nm --example ramfunc --release | grep ' bar::' {{#include ../../../../ci/expected/ramfunc.grep.bar}}``` + +## `binds` + +**NOTE**: Requires RTFM ~0.4.2 + +You can give hardware tasks more task-like names using the `binds` argument: you +name the function as you wish and specify the name of the interrupt / exception +in the `binds` argument. Types like `Spawn` will be placed in a module named +after the function, not the interrupt / exception. Example below: + +``` rust +{{#include ../../../../examples/binds.rs}} +``` +``` console +$ cargo run --example binds +{{#include ../../../../ci/expected/binds.run}}```