Commit Graph

118 Commits

Author SHA1 Message Date
Dario Nieuwenhuis
1c9f98e1b6 nrf/gpiote: fix irq race condition
The interrupt could fire between checking if sense=disabled and registering the waker,
in which case the future would get stuck.
2021-03-29 00:58:58 +02:00
Dario Nieuwenhuis
4ce46df160 Code size optimizations. 2021-03-29 00:58:58 +02:00
Dario Nieuwenhuis
0e8bb5dc0b util: Do not unregister waker on wake in AtomicWaker. 2021-03-29 00:58:58 +02:00
Dario Nieuwenhuis
df42c38492 nrf/uarte: update to new api 2021-03-29 00:58:58 +02:00
Dario Nieuwenhuis
a134fce122 nrf: nicer Peripherals api, add take() 2021-03-29 00:58:57 +02:00
Dario Nieuwenhuis
ba6e0a4058 util: add wake_on_interrupt.
This is a lighter version of InterruptFuture.
2021-03-29 00:58:57 +02:00
Dario Nieuwenhuis
9c4087ac5c Introduce PeripheralBorrow trait 2021-03-29 00:58:57 +02:00
xoviat
6ee9e012fc add embassy::main and implement for stm32f4 2021-03-27 17:27:39 -05:00
Joshua Salzedo
ea650b684c
its /// not //. 2021-03-24 13:31:08 -07:00
Joshua Salzedo
18d3c803de
Add missing newlines 2021-03-24 13:21:32 -07:00
Joshua Salzedo
40617fea04
Document embassy::util::signal & embassy::util 2021-03-24 13:19:36 -07:00
Joshua Salzedo
62009150bd
Document embassy::util::InterruptFuture 2021-03-24 13:19:36 -07:00
Joshua Salzedo
a9e099c215
Document embassy::util::Forever 2021-03-24 13:19:36 -07:00
Joshua Salzedo
da59112e86
Document the DropBomb 2021-03-24 13:19:35 -07:00
Joshua Salzedo
8fbe83ac26
Added remainder of the docs for embassy::time's public interface. 2021-03-21 18:30:03 -07:00
Joshua Salzedo
42be860446
Correct descriptions of Duration 2021-03-21 17:11:30 -07:00
Joshua Salzedo
7988b78107
remove now redundant non-doc comment 2021-03-21 17:05:36 -07:00
Joshua Salzedo
10f14747c3
Fix module-level docstring 2021-03-21 17:05:22 -07:00
Joshua Salzedo
e363607d70
Added doc to the embassy::time::Duration struct 2021-03-21 17:01:52 -07:00
Joshua Salzedo
f8d63279ef
Re-add erroneously removed newlines 2021-03-21 17:01:13 -07:00
Joshua Salzedo
dcdd768e03 Add Struct/impl documentation for embassy::time::Instant 2021-03-21 16:45:53 -07:00
Joshua Salzedo
d453b9dd95 Add Struct/impl documentation for embassy::time::Duration 2021-03-21 16:45:48 -07:00
Joshua Salzedo
cf1323fb67 Add module-level documentation for embassy::time 2021-03-21 16:45:24 -07:00
Michael Beaumont
d3673886b3
Run cargo fmt 2021-03-18 20:02:42 +01:00
Dario Nieuwenhuis
f248bb17ad Allow unused stuff in fmt.rs 2021-03-18 01:42:28 +01:00
Dario Nieuwenhuis
8c2da193b8 Add spawn/spawn_pool APIs to Task 2021-03-18 00:38:27 +01:00
Dario Nieuwenhuis
5c2bf3981e Move Task into raw 2021-03-18 00:20:11 +01:00
Dario Nieuwenhuis
278ce02824 Rename IrqExecutor to InterruptExecutor 2021-03-17 22:52:57 +01:00
Dario Nieuwenhuis
a9076636ac Do not export fmt macros.
This was introduced by accident by me struggling with the weird intra-crate macro importing system...
2021-03-17 22:50:27 +01:00
Dario Nieuwenhuis
bb68f5d0e8 Add optimized single-word WakerRegistration, add AtomicWakerRegistration. 2021-03-17 02:53:41 +01:00
Dario Nieuwenhuis
ab01e0be3b Do not reexport atomic-polyfill 2021-03-17 02:52:21 +01:00
Dario Nieuwenhuis
6ed1a87138 Update features for latest nightly. 2021-03-17 02:48:16 +01:00
Dario Nieuwenhuis
bd3deb785a Update deps 2021-03-04 22:41:54 +01:00
Dario Nieuwenhuis
18f6b8ad68 thumbv6m support with emulated atomics 2021-03-04 21:56:31 +01:00
Dario Nieuwenhuis
88946840d1 Make Delay public 2021-03-02 21:16:43 +01:00
Dario Nieuwenhuis
d4f2c6cf00 Remove cargo namespaced-features 2021-03-02 21:15:12 +01:00
xoviat
7ef81c75e7 traits: add delay trait
delay allows downstream libraries
to use async delay without depending
on a specific delay implementation
2021-03-02 08:45:22 -06:00
xoviat
9626aee7db Move traits to separate crate. 2021-03-02 00:32:23 +01:00
Dario Nieuwenhuis
084b64053a
Merge pull request #61 from xoviat/us-delay
add us delays
2021-03-01 19:06:57 +01:00
xoviat
a7549108a8 rename methods 2021-03-01 11:59:40 -06:00
xoviat
d029f651fa add us delays 2021-03-01 11:47:55 -06:00
Dario Nieuwenhuis
45355f184a move most interrupt methods to InterruptExt extension trait. Fixes #35 2021-03-01 00:44:38 +01:00
Dario Nieuwenhuis
7433dc1039 Port qspi to PeripheralMutex 2021-02-28 22:05:37 +01:00
Dario Nieuwenhuis
da91779117 interrupt: Split set_handler context.
Since introducing the ctx pointer, the handler is now two words, so setting it can
race with the interrupt firing. On race it's possible for the new handler to be
alled with the old ctx pointer or viceversa.

Rather than documenting this, it's better to split the function in two to make it
obvious to the user that it's not atomic. The user can use a critical section, or
disable/enable the interrupt to avoid races if this is a concern.
2021-02-26 02:04:48 +01:00
Dario Nieuwenhuis
17cf301d4f Remove rand(), fixes #50 2021-02-26 01:58:00 +01:00
Dario Nieuwenhuis
11be9170ec Cleanup interrupt package naming. Fixes #40
The `interrupt` package previously tried to be drop-in compatible with the
`interrupt` package from PACs. THis meant that there was both a PAC-style enum
value `UARTE0` and an embassy-style owned `UARTE0Interrupt` type. This made
things VERY confusing.

This drops compatibility with the PAC, improving the names for embassy interrupts.
2021-02-26 01:55:27 +01:00
Dario Nieuwenhuis
90476ef900 Fix some warnings. 2021-02-26 01:06:58 +01:00
fnafnio
f779ec4928 update defmt and defmt-rtt to 0.2.0 2021-02-24 08:44:23 +01:00
Dario Nieuwenhuis
7321ddb0b3 Update to cortex-m 0.7 2021-02-14 23:26:50 +01:00
Thales Fragoso
b69f72e055 Get rid of some warnings 2021-02-13 21:41:36 -03:00