Commit Graph

38 Commits

Author SHA1 Message Date
Dániel Buga
2809e926cf Allow arbitrary expressions as pool_size 2023-06-25 23:10:48 +02:00
Dániel Buga
aa0ab06645 Update darling 2023-06-25 22:24:48 +02:00
Dario Nieuwenhuis
921780e6bf Make interrupt module more standard.
- Move typelevel interrupts to a special-purpose mod: `embassy_xx::interrupt::typelevel`.
- Reexport the PAC interrupt enum in `embassy_xx::interrupt`.

This has a few advantages:
- The `embassy_xx::interrupt` module is now more "standard".
  - It works with `cortex-m` functions for manipulating interrupts, for example.
  - It works with RTIC.
- the interrupt enum allows holding value that can be "any interrupt at runtime", this can't be done with typelevel irqs.
- When "const-generics on enums" is stable, we can remove the typelevel interrupts without disruptive changes to `embassy_xx::interrupt`.
2023-06-08 18:00:48 +02:00
Dario Nieuwenhuis
404aa29289 cortex-m: remove owned interrupts. 2023-06-01 03:25:19 +02:00
Jesse Braham
4e9ed223a9 Allow for an optional user-defined entry macro when targeting RISC-V 2023-05-16 09:37:25 -07:00
Dario Nieuwenhuis
b41ee47115 executor: unify export mod. 2023-04-03 01:11:42 +02:00
Dario Nieuwenhuis
e7a19a9725 macros/main: copy fn return to task.
This prevents this bad code from compiling.

```rust
async fn main(_spawner: Spawner) -> ! {
    // not really noreturn!
}
```
2023-03-08 02:03:39 +01:00
Dario Nieuwenhuis
a614e697d0 macros: better validation of function signatures.
Fixes #1266
2023-03-08 01:59:06 +01:00
Dario Nieuwenhuis
a054891263 cortex-m: rename Handler to DynHandler.
I want to use the name Handler for the new interrupt binding macro.
2023-03-06 00:17:51 +01:00
Dario Nieuwenhuis
b5cf332cc0 nrf: docs. 2023-02-01 01:17:41 +01:00
Brendon Fallquist
056eac998a Hide doc comments from inner function include doc comments on outer function 2022-12-24 21:21:07 -06:00
Ulf Lilleengen
04a7d97673
refactor: autodetect macro variant
Export all main macro per target architecture from embassy-macros,
and select the appropriate macro in embassy-executor.
2022-11-23 13:54:59 +01:00
Sijmen Woutersen
6e1120e17e riscv support 2022-11-10 17:39:41 +01:00
Ulf Lilleengen
045ae2c29f Ensure interrupt::take works without embassy-executor
Add "rtos-trace-interrupt" feature flag on embassy-macros and enable it
for embassy-executor, to ensure that the interrupt::take! macro can be
used without depending on embassy-executor.
2022-08-25 12:46:24 +02:00
Dario Nieuwenhuis
478f472784 Remove Forever, switch to static_cell. 2022-08-22 16:11:40 +02:00
Quentin Smith
71e468681b Merge branch 'master' of https://github.com/embassy-rs/embassy into rtos-trace 2022-08-19 00:53:41 -04:00
Dario Nieuwenhuis
5daa173ce4 Split embassy-time from embassy-executor. 2022-08-18 01:22:30 +02:00
Dario Nieuwenhuis
fc6e1e06b3 Remove HAL initialization from #[embassy::main] macro. 2022-08-17 22:16:46 +02:00
Dario Nieuwenhuis
bd0aaec624 macros: remove embassy_prefix attr.
This was used in the past for reexporting the macros from drogue-device,
which is no longer using it.

Also, it is a pain to support, so we don't want it.
2022-08-17 15:04:59 +02:00
Dario Nieuwenhuis
ef9e373ec4 macros/interrupt_take: do not assume embassy-executor is a dependency of the user crate. 2022-08-17 15:03:23 +02:00
Quentin Smith
0bf178dd1b Add separate feature flag to enable interrupt tracing 2022-08-16 00:42:08 -04:00
Quentin Smith
a3c1522ce6 Add support for rtos-trace behind a feature flag 2022-08-10 05:04:13 -04:00
Dario Nieuwenhuis
a0f1b0ee01 Split embassy crate into embassy-executor, embassy-util. 2022-07-29 23:40:36 +02:00
Dario Nieuwenhuis
4901c34d9c Rename Unborrowed -> PeripheralRef, Unborrow -> Peripheral 2022-07-23 14:00:19 +02:00
Dario Nieuwenhuis
be6408e202 Rename unsafe_impl_unborrow to impl_unborrow 2022-07-23 01:33:22 +02:00
Dario Nieuwenhuis
715fa51468 Reuse unsafe_impl_unborrow in other macros. 2022-07-23 01:33:22 +02:00
Grant Miller
65a82d02d1 WIP: Make unborrow safe to use 2022-07-23 01:33:22 +02:00
Dario Nieuwenhuis
a8703b7598 Run rustfmt. 2022-06-12 22:22:31 +02:00
Dario Nieuwenhuis
5085100df2 Add embassy-cortex-m crate.
- Move Interrupt and InterruptExecutor from `embassy` to `embassy-cortex-m`.
- Move Unborrow from `embassy` to `embassy-hal-common` (nothing in `embassy` requires it anymore)
- Move PeripheralMutex from `embassy-hal-common` to `embassy-cortex-m`.
2022-06-12 21:45:38 +02:00
bors[bot]
2f43969dd4
Merge #742
742: Only 1 argument in embassy::main when there is no HAL r=Dirbaio a=jbeaurivage

There is a slight mistake in an error message from `[embassy::main]` macro. When there is no HAL specified, `main` should take only one argument.

Co-authored-by: Justin Beaurivage <justin@wearableavionics.com>
2022-04-29 14:29:26 +00:00
Justin Beaurivage
c53b2fdc05 Require 1 argument in embassy::main without HAL 2022-04-29 09:32:31 -04:00
Dario Nieuwenhuis
1599009a4f executor: "send-spawn is OK if the args are Send" only holds for async fn futures.
The normal `spawn()` methods can be called directly by the user, with arbitrary hand-implemented futures.
We can't enforce they're only called with `async fn` futures. Therefore, make these
require `F: Send`, and add a "private" one only for use in the macro, which can enforce it.
2022-04-27 04:56:41 +02:00
Dario Nieuwenhuis
6f6c16f449 executor: make send-spawning only require the task args to be Send, not the whole future. 2022-04-27 04:56:41 +02:00
Dario Nieuwenhuis
293f54d134 executor: add raw::TaskPool.
This simplifies the macro code a bit.
2022-04-27 04:56:41 +02:00
Dario Nieuwenhuis
96d917992c macros: simplify task macro using "TAIT laundering". 2022-04-26 18:40:45 +02:00
Dario Nieuwenhuis
c4cecec10c macros: isolate the TAIT into its own mod.
This fixes type inference issues due to the TAIT's defining scope
being the whole parent mod.
2022-04-25 22:18:52 +02:00
Dario Nieuwenhuis
408617266e Update Rust nightly.
Fixes a new opaque type error in the task macro.
Full error is "opaque type's hidden type cannot be another opaque type from the same scope".
This got disallwed by the lazy-TAIT PR: https://github.com/rust-lang/rust/pull/94081

Sadly there's now some weird type inference errors with pre-lazy-TAIT
nightlies, so support for those is dropped.
2022-04-24 04:24:08 +02:00
Dario Nieuwenhuis
611961b499 macros: cleanup, make work in stable. 2022-02-12 01:16:31 +01:00