diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2023-05-23 06:26:28 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-23 06:26:28 +0000 |
| commit | 62162241d4c7d82dfbb310113f7525d134cfde9b (patch) | |
| tree | 4346cbe248835eba381003d8592248102028dac5 /book/en/src/migration_v1_v2.md | |
| parent | 21b0d97e17922c023a3b5d8148a414d4277f7b87 (diff) | |
| parent | 9fa073f7936782bddf5d02b7b1949032e84de1bd (diff) | |
Merge #741
741: Docs 2 r=korken89 a=datdenkikniet
Working on the migration guide and other docs
TODO:
- [x] Migration guide
- [x] Hardcoded examples should link to example code that is tested (this was already done, AFAICT)
- [x] Address #699
- [x] Discuss: should we remove references to non-v2, apart from the migration guide and link to the book for v1? (Off-github conclusion: yes)
- [x] RTIC {vs,and} Embassy (important: distinction between embassy runtime & HALs)
- [x] More descriptive docs on how to implement & PR implementations of `Monotonic` to `rtic-monotonics`
Co-authored-by: datdenkikniet <jcdra1@gmail.com>
Diffstat (limited to 'book/en/src/migration_v1_v2.md')
| -rw-r--r-- | book/en/src/migration_v1_v2.md | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/book/en/src/migration_v1_v2.md b/book/en/src/migration_v1_v2.md new file mode 100644 index 0000000..173b964 --- /dev/null +++ b/book/en/src/migration_v1_v2.md @@ -0,0 +1,18 @@ +# Migrating from v1.0.x to v2.0.0 + +Migrating a project from RTIC `v1.0.x` to `v2.0.0` involves the following steps: + +1. `v2.0.0` requires [`#![type_alias_impl_trait]`](https://github.com/rust-lang/rust/issues/63063) and Rust Nightly. +2. Migrating from the monotonics included in `v1.0.x` to `rtic-time` and `rtic-monotonics`, replacing `spawn_after`, `spawn_at`. +3. Software tasks are now required to be `async`, and using them correctly. +4. Understanding and using data types provided by `rtic-sync`. + +For a detailed description of the changes, refer to the subchapters. + +If you wish to see a code example of changes required, you can check out [the full example migration page](./migration_v1_v2/complete_example.md). + +#### TL;DR (Too Long; Didn't Read) +1. Add `#![type_alias_impl_trait]` to your crate, and use `cargo +nightly`. +2. Instead of `spawn_after` and `spawn_at`, you now use the `async` functions `delay`, `delay_until` (and related) with impls provided by `rtic-monotonics`. +3. Software tasks _must_ be `async fn`s now. Not returning from a task is allowed so long as there is an `await` in the task. You can still `lock` shared resources. +4. Use `rtic_sync::Arbiter` to `await` access to a shared resource, and `rtic-channel` to communicate between tasks instead of `spawn`-ing new ones.
\ No newline at end of file |
