diff options
| author | Henrik Tjäder <henrik@tjaders.com> | 2020-10-02 09:55:25 +0000 |
|---|---|---|
| committer | Henrik Tjäder <henrik@tjaders.com> | 2020-10-02 09:55:25 +0000 |
| commit | 1482a251867bfb31708e8c7273db4bee1e67df36 (patch) | |
| tree | f4acc54e9c63e9c174f1374be4d9abde37b704af /book | |
| parent | 755bb191b6ccd9b3abeca7a0a9b02218caba3a99 (diff) | |
Describe the resource struct attribute migration steps
Diffstat (limited to 'book')
| -rw-r--r-- | book/en/src/migration.md | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/book/en/src/migration.md b/book/en/src/migration.md index ab45c29..7be3094 100644 --- a/book/en/src/migration.md +++ b/book/en/src/migration.md @@ -66,6 +66,37 @@ mod app { } ``` +### Resources struct - #[resources] + +Previously the RTIC resources had to be in in a struct named exactly "Resources": + +``` rust +struct Resources { + // Resources defined in here +} +``` + +With RTIC v0.6.0 the resources struct is annotated similarly like +`#[task]`, `#[init]`, `#[idle]`: with an attribute `#[resources]` + +``` rust +#[resources] +struct Resources { + // Resources defined in here +} +``` + +In fact, the name of the struct is now up to the developer: + +``` rust +#[resources] +struct whateveryouwant { + // Resources defined in here +} +``` + +would work equally well. + ## Migrating from v0.4.x to v0.5.0 This section covers how to upgrade an application written against RTIC v0.4.x to |
