Commit graph

268 commits

Author SHA1 Message Date
Emil Fresk
e8b4fa7b32 Added critical sections 2020-10-08 17:33:16 +02:00
Emil Fresk
6d003e20a8 Now core contains the same Peripherals type based on monotonic 2020-10-07 15:17:00 +02:00
Per Lindgren
aac97a2109 spawn POC works, likely unsound, cleanup 2020-10-05 22:02:04 +02:00
Per Lindgren
6bd168d711 spawn POC works, likely unsound 2020-10-05 21:57:44 +02:00
Emil Fresk
8ab7be9871 Added back accidentally removed block 2020-10-05 20:19:52 +02:00
Emil Fresk
44f26fe90c Move to master of rtic-syntax 2020-10-05 20:05:52 +02:00
Emil Fresk
eec0908024 Merge branch 'master' into always_late_resources 2020-10-05 18:25:15 +02:00
Henrik Tjäder
95503b6bdf Use latest rtic-syntax master 2020-10-05 08:24:33 +00:00
Henrik Tjäder
1e46ffdfbc
Merge branch 'master' into mod_const 2020-10-02 11:36:28 +02:00
Emil Fresk
fb61a78cdd Added bare_metal::CriticalSection to init::Context 2020-10-01 20:01:25 +02:00
Emil Fresk
e7f0d9c3e3 Now late resources are always used 2020-10-01 19:38:49 +02:00
Henrik Tjäder
96e6350c0d Rename const_app to mod_app 2020-10-01 16:22:37 +00:00
Henrik Tjäder
3ab2c049c5 Remove stale comment 2020-09-29 11:56:56 +00:00
Henrik Tjäder
487fea45ce Keep user code as-is within the module, add example 2020-09-29 11:56:56 +00:00
Henrik Tjäder
5b17f8b599 Due to new module boundaries the schedule fn needs to be pub 2020-09-25 14:33:08 +00:00
Henrik Tjäder
a151974245 cfg_core is gone, cargo fmt 2020-09-25 14:33:02 +00:00
Henrik Tjäder
6d234f9c95 Use dev-branch for mod_const 2020-09-25 14:29:34 +00:00
Henrik Tjäder
86578b76fb Add format_ident imports 2020-09-25 14:29:34 +00:00
Henrik Tjäder
2881cc8f43 Modify macro tests, use mod instead of const 2020-09-25 14:29:34 +00:00
Henrik Tjäder
0c7a619432 Compose the use-statements, reduce debug-printouts 2020-09-25 14:29:34 +00:00
Henrik Tjäder
9fd052b876 Collect and generate required use-statements 2020-09-25 14:29:34 +00:00
Henrik Tjäder
46bf583cc2 Handle user hardware and software tasks and some resources 2020-09-25 14:29:34 +00:00
Henrik Tjäder
c718413cb5 Generate mod instead of const, handle import of idle and init 2020-09-25 14:29:34 +00:00
Henrik Tjäder
148ad4045e Update documentation where const is replaced by mod 2020-09-25 14:29:34 +00:00
Henrik Tjäder
ad2b809078 Use rtic-rs master 2020-09-04 07:32:53 +00:00
Henrik Tjäder
d06cf91acc Remove stale code, fix comment styling 2020-09-01 17:48:53 +00:00
Henrik Tjäder
d8c9476372 Since there only will be one init/idle use .first().unwrap(), matching rtic-syntax 2020-09-01 17:48:53 +00:00
Henrik Tjäder
f151d5871c Cargo fmt 2020-09-01 14:50:06 +00:00
Henrik Tjäder
76cf14c520 Brutally yank out multicore 2020-09-01 14:50:06 +00:00
Emil Fresk
697ee6e14c Preparing v0.5.5 release 2020-08-27 14:53:50 +02:00
Henrik Tjäder
a4eb8c576c Reuse cortex-m 2020-08-27 12:33:51 +00:00
Emil Fresk
5711a2472d Preparing for 0.5.4 release 2020-08-26 12:41:39 +02:00
Per Lindgren
e297ceb1ad rtic::export::Peripherals created by into instead of transmute 2020-07-09 19:37:04 +02:00
Emil Fresk
d9e8b68662 Fixes an issue where one could double take the cortex_m Peripheral
Added qemu test

Added comment

Typo

Add cfg for homogeneous

More cfg

Now multicore working

Add .run file
2020-06-30 22:06:57 +02:00
Henrik Tjäder
602a5b4374 Rename RTFM to RTIC 2020-06-11 17:18:29 +00:00
Emil Fresk
eb6406da7e Fmt 2020-06-11 19:00:52 +02:00
bors[bot]
8898224950
Merge #314
314: do not optimize build deps r=korken89 a=japaric

this may make CI faster

Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2020-06-11 16:33:39 +00:00
bors[bot]
4795c1dba3
Merge #315
315: allow handlers to be named 'main' r=korken89 a=japaric

`#[init]`, `#[idle]` and `#[task]` handlers can now be named `main`

fixes #311

Co-authored-by: Jorge Aparicio <jorge.aparicio@ferrous-systems.com>
2020-06-11 16:22:33 +00:00
Henrik Tjäder
137283959c Run cargo fmt 2020-06-03 10:34:01 +00:00
Jorge Aparicio
0ad311074e allow handlers to be named 'main'
`#[init]`, `#[idle]` and `#[task]` handlers can now be named `main`

fixes #311
2020-05-29 14:50:28 +02:00
Jorge Aparicio
3ed4fe3771 TODO(remove) codegen no-op 2020-05-26 22:21:32 +02:00
Henrik Tjäder
f58f37b2b9 Retain cfg-attributes on resources 2020-04-22 09:26:13 +00:00
Jorge Aparicio
4fcb6ab7cc v0.5.0 final release 2019-11-14 17:47:17 -05:00
Jorge Aparicio
9f092efe24 do not zero late resource memory on boot 2019-10-21 16:38:04 -05:00
Jorge Aparicio
eb2ec7a4c8 v0.5.0 beta release 2019-10-15 16:35:00 -05:00
Jorge Aparicio
7f1b493c7d turn git deps into crates.io deps 2019-09-15 22:57:43 +02:00
Jorge Aparicio
c8197f524e fix gh-pages build 2019-09-15 20:19:48 +02:00
Jorge Aparicio
7aa270cb92 don't use deprecated API 2019-09-15 18:36:00 +02:00
Jorge Aparicio
996bdf8f0c doc tweaks 2019-08-21 12:33:04 +02:00
Jorge Aparicio
45f9faae9c document #[app] 2019-08-21 12:19:38 +02:00
Jorge Aparicio
0e146f8d11 adapt to changes in rtfm-syntax 2019-08-20 15:17:37 +02:00
Jorge Aparicio
fb84029bee implement the #[shared] attribute as specified in RFC #211 2019-07-11 12:53:58 +02:00
Jorge Aparicio
9195038c87 implement RFC #212 2019-07-10 22:42:44 +02:00
Jorge Aparicio
14d63f4961 fix (cross-core) initialization barriers 2019-07-03 20:36:52 +02:00
Jorge Aparicio
be92041a59 WIP 2019-06-29 09:11:57 +02:00
Jorge Aparicio
df4a7fd3e5 check that the app is not compiled for more cores than were specified 2019-06-24 14:15:00 +02:00
Jorge Aparicio
596cf585ea Monotonic trait is safe; add MultiCore trait 2019-06-24 14:09:12 +02:00
Jorge Aparicio
4e51bb68b9 RFC #207 2019-06-20 06:19:59 +02:00
Jorge Aparicio
9897728709 add homogeneous multi-core support 2019-06-18 10:31:31 +02:00
Jorge Aparicio
81275bfa4f rtfm-syntax refactor + heterogeneous multi-core support 2019-06-13 23:56:59 +02:00
bors[bot]
fafeeb2727 Merge #194
194: bump heapless dependency to v0.5.0; remove "nightly" feature r=japaric a=japaric

with the upcoming version of heapless we are able to initialize all internal
queues in const context removing the need for late initialization

this commit also removes the "nightly" feature because all the optimization
provided by it are now enabled by default

Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2019-05-21 19:15:18 +00:00
Jorge Aparicio
30d6327001 bump heapless dependency to v0.5.0; remove "nightly" feature
with the upcoming version of heapless we are able to initialize all internal
queues in const context removing the need for late initialization

this commit also removes the "nightly" feature because all the optimization
provided by it are now enabled by default
2019-05-21 15:22:25 +02:00
Jorge Aparicio
0fb2726e6c remove unused check
that was added in #140 but it's no longer required
2019-05-21 14:43:05 +02:00
Jorge Aparicio
fafc94ccfb removes the maybe_uninit feature gate
and stop newtyping `core::mem::MaybeUninit`
2019-05-21 14:18:43 +02:00
bors[bot]
6acb156482 Merge #189
189: write generated code to disk for easier inspection r=japaric a=japaric

now that the generated code is actually readable let's make it easier to access

this commit also documents how to inspect the generated code via
`rtfm-expansion.rs` and `cargo-expand`

Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2019-05-09 19:53:56 +00:00
Jorge Aparicio
36073a6342 generate resource proxies only when needed
only `static mut` resources need proxies
2019-05-09 18:25:34 +02:00
Jorge Aparicio
d4eb4d2c47 write generated code to disk for easier inspection
now that the generated code is actually readable let's make it easier to access

this commit also documents how to inspect the generated code via
`rtfm-expansion.rs` and `cargo-expand`
2019-05-08 14:08:09 +02:00
Jorge Aparicio
485601245b rtfm::app: update error message 2019-05-01 20:49:25 +02:00
Jorge Aparicio
a452700628 implement RFCs 147 and 155, etc.
This commit:

- Implements RFC 147: "all functions must be safe"

- Implements RFC 155: "explicit Context parameter"

- Implements the pending breaking change #141: reject assign syntax in `init`
  (which was used to initialize late resources)

- Refactors code generation to make it more readable -- there are no more random
  identifiers in the output -- and align it with the book description of RTFM
  internals.

- Makes the framework hard depend on `core::mem::MaybeUninit` and thus will
  require nightly until that API is stabilized.

- Fixes a ceiling analysis bug where the priority of the system timer was not
  considered in the analysis.

- Shrinks the size of all the internal queues by turning `AtomicUsize` indices
  into `AtomicU8`s.

- Removes the integration with `owned_singleton`.
2019-05-01 20:49:25 +02:00
Jorge Aparicio
a562fb3232 v0.4.3 2019-04-21 18:20:57 +02:00
bors[bot]
77def32454 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>
2019-04-16 22:54:18 +00:00
Jorge Aparicio
210921e06c now fix the fix 2019-04-17 00:18:02 +02:00
Jorge Aparicio
53f0ca1504 more nightly fixes 2019-04-16 23:41:00 +02:00
Jorge Aparicio
10d2638488 [NFC] fix nightly ci 2019-04-16 23:17:28 +02:00
Jorge Aparicio
aa7eec0299 check task priority at compile time
before we were checking the priority at runtime. The compile time error message
when the priority is too high is kind of awful though.
2019-04-16 23:04:24 +02:00
Jorge Aparicio
3310f507c0 v0.4.2 2019-02-27 00:56:56 +01:00
Jorge Aparicio
8eccef7d9c refactor: make binds harder to misuse 2019-02-26 23:25:16 +01:00
Jorge Aparicio
2fd6ae69d1 binds can only appear once in the argument list 2019-02-26 23:22:34 +01:00
Jorge Aparicio
11f795aaf6 add binds example and make it work 2019-02-26 23:22:34 +01:00
Jorge Aparicio
72f0cc505a make cfail test actually fail 2019-02-26 23:22:34 +01:00
Jorge Aparicio
d0f33add0a add binds argument to the interrupt and exception attributes 2019-02-26 23:22:31 +01:00
Jorge Aparicio
73529ea650 reject duplicate arguments in #[interrupt] and #[exception]
This program was being accepted:

``` rust
 #[task(
    capacity = 1,
    capacity = 2,
    priority = 1,
    priority = 2,
)]
fn foo() {}
```

now it will trigger a compiler error
2019-02-23 22:35:29 +01:00
Jorge Aparicio
88078e7770 add "nightly" feature 2019-02-19 12:37:25 +01:00
Jorge Aparicio
e5e54ee8f1 rebase fix 2019-02-16 00:28:12 +01:00
Jorge Aparicio
7ce052be37 cargo fmt 2019-02-16 00:26:07 +01:00
Jorge Aparicio
2b8e743f35 make debug builds reproducible 2019-02-16 00:25:48 +01:00
Hugo van der Wijst
577d188f72 Make generated names stable when sorting. 2019-02-16 00:23:01 +01:00
Hugo van der Wijst
a654d13eef Seed RNG with package name and prepend string to full random name. 2019-02-16 00:23:01 +01:00
Hugo van der Wijst
be8a5e89b8 Make identifiers deterministic. 2019-02-16 00:23:01 +01:00
Hugo van der Wijst
2f89688ca9 Make builds reproducible
This is done by using `BTreeMap`s and `BTreeSet`s to get deterministic
ordering.

Also updated the CI job to check reproducibility of all examples.
2019-02-16 00:22:22 +01:00
Jorge Aparicio
5f7e831d27 fix non_camel_case_types warnings 2019-02-13 15:37:24 +01:00
Jorge Aparicio
aadd00c068 bump macros version 2019-02-12 17:29:50 +01:00
Jorge Aparicio
88599780e0 accept init: fn() -> init::LateResources 2019-02-12 14:53:49 +01:00
Jorge Aparicio
557a51ede1 forbid early returns in init 2019-02-12 11:07:15 +01:00
Hugo van der Wijst
45e98afbc1 Fix build on recent nightlies. 2019-01-17 10:55:21 -08:00
Jorge Aparicio
d98f6c9a61 v0.4.0 2018-12-16 21:19:19 +01:00
Jorge Aparicio
56d09a12dd move macros crate to the 2018 edition 2018-12-16 19:14:58 +01:00
Jorge Aparicio
8e9a91d0b0 properly handle #[cfg] (conditional compilation) on tasks 2018-12-16 19:10:36 +01:00
Jorge Aparicio
4345c10596 properly handle #[cfg] (conditional compilation) on resources 2018-12-16 18:37:36 +01:00
Jorge Aparicio
9757c33b00 use the single core variant of spsc::Queue 2018-12-16 01:11:54 +01:00
Jorge Aparicio
4f00d8bd78 codegen/statics: forward #[cfg] attributes
fixes #110
2018-12-15 22:04:30 +01:00
Jorge Aparicio
d14e25d72d move some interrupt configuration to pre_init 2018-12-15 20:35:00 +01:00
Jorge Aparicio
f7ac71ab22 codegen: merge dictionaries related to task dispatchers 2018-12-15 19:17:08 +01:00
Jorge Aparicio
0b3f0b2eb5 codegen: merge dictionaries related to tasks 2018-12-15 19:07:09 +01:00
Jorge Aparicio
35bb76ef5f codegen: stop using export_name
`export_name` creates external symbols that won't be removed when using `-Z
emit-stack-sizes`
2018-12-02 17:43:36 +01:00
Jorge Aparicio
9d0227bfeb 0.4.0-beta.2 2018-11-04 20:12:31 +01:00
Jorge Aparicio
22d758ddac fix codegen 2018-11-04 19:46:49 +01:00
Jorge Aparicio
37a0692a0f impl Mutex on all shared resources
document how to write generic code that operates on resources
2018-11-04 18:50:42 +01:00
Jorge Aparicio
3a867e70c3 update macros/Cargo.toml 2018-11-03 17:24:45 +01:00
Jorge Aparicio
c631049efc v0.4.0
closes #32
closes #33
2018-11-03 17:16:55 +01:00
Jorge Aparicio
2ec5d59ee9 v0.3.3 2018-08-24 16:49:03 +02:00
Jorge Aparicio
abca829926 more fixes 2018-08-24 16:31:04 +02:00
Ferdia McKeogh
5a3605050e Fix mistakes in dependencies 2018-06-07 11:50:14 +01:00
Ferdia McKeogh
14b1811182 Fix "Could not find Op in proc_macro" 2018-06-07 11:45:11 +01:00
Jorge Aparicio
8767f625d8 switch to a crates.io release of rtfm-syntax 2018-04-16 23:22:01 +02:00
Jorge Aparicio
7fdf16eab9 update parser
closes #69

this doesn't change functionality per se but improves diagnostics in some cases. Some hard errors
have becomes warnings, for example: when `resources` is empty, or when `idle.path` is set to the
default `idle` path.
2018-04-16 21:32:29 +02:00
Jorge Aparicio
def4fc8079 v0.3.0 2018-01-15 23:33:09 +01:00
Jorge Aparicio
1be43fc489 adapt to changes in the cortex-m crate 2018-01-11 20:56:45 +01:00
Jorge Aparicio
88f505369c switch to master branches 2017-12-23 11:17:03 +01:00
Jorge Aparicio
b00f4fec14 add missing comma 2017-12-17 10:00:56 +01:00
Jorge Aparicio
d30bdcb096 safe &'static mut references via init.resources 2017-12-09 17:17:56 +01:00
Jorge Aparicio
a6dd004113 implement the Resource trait for owned resources
this unbreaks the "generics" example
2017-12-09 17:17:56 +01:00
Jorge Aparicio
219e172680 drop the Static wrapper 2017-12-09 17:15:15 +01:00
Jorge Aparicio
62c5c1ae43 make resource proxies not Sync 2017-12-09 16:13:22 +01:00
Jorge Aparicio
9865a7246d make resource proxies !Send 2017-12-09 15:10:29 +01:00
Jorge Aparicio
79e2b7dc2e rename LateResourceValues to LateResources 2017-12-09 13:20:41 +01:00
Jorge Aparicio
1830bdbe5c remove special case around peripherals from codegen 2017-12-09 13:08:08 +01:00
Jorge Aparicio
e97afa71ce peripherals as scoped singletons 2017-12-09 12:45:57 +01:00
Jorge Aparicio
948e1fd0fb v0.2.2 2017-11-22 09:29:01 +01:00
Jorge Aparicio
2415a640af fix idle::Resources::new
it assumed that all resources were "early" resources
2017-10-02 14:49:40 +02:00
Jonas Schievink
b50c9095c0 Use rtfm-syntax 0.2.0 2017-09-22 20:11:39 +02:00
Jonas Schievink
1556948458 Fix shared resource handling and extend example.
The extended example tests that this actually works this time.
2017-09-22 18:19:18 +02:00
Jonas Schievink
70e243694d Simplify iterator usage 2017-09-22 18:10:00 +02:00
Jonas Schievink
57ed0963ff Use untagged_option crate 2017-09-06 19:06:43 +02:00
Jonas Schievink
7ebba49644 Allow initialization of resources in init. 2017-09-03 18:19:21 +02:00
Jorge Aparicio
6160548153 v0.2.0 2017-07-29 01:17:54 -05:00
Jorge Aparicio
2d80f3631b update examples 2017-07-29 00:46:38 -05:00
Jorge Aparicio
271df39bdb Send-ness check is now in rtfm-core 2017-07-27 21:30:24 -05:00
Jorge Aparicio
b9f50e432e make task.$T.path mandatory 2017-07-27 19:39:18 -05:00
Jorge Aparicio
d396da5950 make task.$T.enabled optional
and move the logic that differentiates interrupts from exceptions from the crate
to the procedural macro logic
2017-07-27 17:08:42 -05:00
Jorge Aparicio
dd539d114f don't generate empty modules 2017-07-27 12:29:52 -05:00
Jorge Aparicio
b37c45ad2a make task.$T.priority optional
default the value to 1 if omitted
2017-07-27 12:11:22 -05:00
Jorge Aparicio
0b5afce771 refactor Resource / Threshold into its own crate, drop task!, tweak rtfm::atomic
task! can be re-added in a backward compatible fashion and I'd like to not have
two ways to assign a task handler to an interrupt / exception in the first
release.

rtfm::atomic now uses the `Threshold` token instead of the `CriticalSection`
token. This reduces overhead by dropping the "are interrupts enabled?" check.
2017-07-27 11:37:58 -05:00
Jorge Aparicio
dee2fcde71 provide a Threshold token even when all resources are lockless
because the token will always be required for calling generic functions
2017-07-26 19:30:47 -05:00
Jorge Aparicio
4a1509cb53 fix around owned idle resource 2017-07-26 17:01:53 -05:00
Jorge Aparicio
8aa3621034 fix errors around the use of super in relative paths 2017-07-25 22:27:57 -05:00
Jorge Aparicio
0e05682d09 more "hygiene"
prepend an underscore to the name of the statics generated in the root of the
crate
2017-07-24 23:07:11 -05:00
Jorge Aparicio
fb4542818b task! is not needed if tasks.$T.path is specified 2017-07-24 22:46:29 -05:00
Jorge Aparicio
f5a4d8e904 don't wrap static references in a Static 2017-07-23 20:59:35 -05:00
Jorge Aparicio
f3b397f460 drop rtfm::Cell 2017-07-23 20:51:37 -05:00