Commit Graph

362 Commits

Author SHA1 Message Date
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
Dario Nieuwenhuis
de796d3e80
Merge pull request #53 from fnafnio/defmt-update
update defmt and defmt-rtt to 0.2.0
2021-02-26 00:30:00 +01:00
Dario Nieuwenhuis
d4a97ac3ed
Merge pull request #54 from xoviat/fix-exti
stm32f4: exti: clear interrupt pending bit
2021-02-24 19:17:35 +01:00
xoviat
582fe34dcc stm32f4: exti: clear interrupt pending bit
bit should be cleared when created
2021-02-24 09:36:49 -06:00
fnafnio
2893fb3733 fixed display hints in examples 2021-02-24 08:57:06 +01:00
fnafnio
f779ec4928 update defmt and defmt-rtt to 0.2.0 2021-02-24 08:44:23 +01:00
Dario Nieuwenhuis
465ca9086d Fix macro if user crate is not using feature(const_in_array_repeat_expressions) 2021-02-23 23:05:18 +01:00
Dario Nieuwenhuis
67c03e1a38
Merge pull request #47 from akiles/simpler-rtc
SImplify rtc overflow handling
2021-02-20 01:51:53 +01:00
Dario Nieuwenhuis
91aaea761e Use Relaxed atomics with fence instead of SeqCst 2021-02-20 01:43:10 +01:00
Dario Nieuwenhuis
68a345eff8
Merge pull request #49 from thalesfragoso/st-timer
Add STM timer
2021-02-20 01:41:42 +01:00
Dario Nieuwenhuis
82846d164c stm32f4-examples: add workaround for WFI breaking RTT 2021-02-20 01:29:26 +01:00
Dario Nieuwenhuis
3b3b1ba346 Enable rust-analyzer proc-macros 2021-02-20 00:27:34 +01:00
Dario Nieuwenhuis
03ddc949a0 PeripheralMutex should be Unpin 2021-02-20 00:27:24 +01:00
Thales Fragoso
e16e3780fd Add missing interrupts for stm32f4 2021-02-17 19:41:23 -03:00
Thales Fragoso
fc7977bd9a Add remaining stm32f4 timers 2021-02-17 19:41:00 -03:00
Thales Fragoso
9d895a6383 Add RTC timer for stm32f4 2021-02-17 19:40:27 -03:00
Dario Nieuwenhuis
406f3b7cbf rtc: use SeqCst for periods. 2021-02-15 01:23:15 +01:00
Dario Nieuwenhuis
9d5e2d3881 SImplify rtc overflow handling 2021-02-15 01:01:45 +01:00
Dario Nieuwenhuis
e454969000
Merge pull request #46 from akiles/cm07
Update to cortex-m 0.7
2021-02-14 23:38:08 +01:00
Dario Nieuwenhuis
7321ddb0b3 Update to cortex-m 0.7 2021-02-14 23:26:50 +01:00
Dario Nieuwenhuis
957741c10f
Merge pull request #45 from thalesfragoso/remove-warn
Get rid of some warnings
2021-02-14 22:11:39 +01:00
Thales Fragoso
b69f72e055 Get rid of some warnings 2021-02-13 21:41:36 -03:00
Dario Nieuwenhuis
a7797a918d nrf/gpiote: new api: switch to owned structs, implement WaitForHigh/WaitForLow. 2021-02-04 23:56:17 +01:00
Dario Nieuwenhuis
1879703153 CriticalSectionMutex should require Send. 2021-02-03 16:29:35 +01:00
Dario Nieuwenhuis
42c9a603bb Add embassy-std-examples 2021-02-03 05:05:05 +01:00
Dario Nieuwenhuis
cbea07716b Set alarm in std executor 2021-02-03 05:01:30 +01:00
Dario Nieuwenhuis
d71c4b4551 Make spawners Copy+Clone 2021-02-03 04:41:46 +01:00
Dario Nieuwenhuis
dc8240229b Remove set_alarm in std executor 2021-02-03 04:37:05 +01:00
Dario Nieuwenhuis
c8a79c151a Test embassy-std builds in CI 2021-02-03 04:30:20 +01:00
Dario Nieuwenhuis
4192e52629 Update embassy-std to new executor api 2021-02-03 04:30:11 +01:00
Dario Nieuwenhuis
edca627286
Merge pull request #44 from akiles/executor-v2
Executor API V2.
2021-02-03 03:47:40 +01:00
Dario Nieuwenhuis
aeaa34d7a1 Executor API V2.
- It's no longer possible to call run() reentrantly from within a task (soundness issue)
- it's now possible to spawn Send tasks across threads (SendSpawner, #37)
2021-02-02 05:20:41 +01:00
Dario Nieuwenhuis
d098952077 stm32f4/examples: add config and linker script so they're runnable. 2021-01-21 19:00:43 +01:00
Dario Nieuwenhuis
9240a1f437 stm32: add stm32f411 interrupts 2021-01-21 18:59:56 +01:00
Dario Nieuwenhuis
dd47bfbc2e stm32f4: Remove stm32f405 being default feature 2021-01-21 18:59:11 +01:00
Dario Nieuwenhuis
a44ab63341
Merge pull request #13 from xoviat/stm32-interrupt
Add EXTI interrupt handler for GPIO pins
2021-01-21 18:17:28 +01:00
xoviat
27cd3a03dc exti: add new ExtiPin driver 2021-01-21 11:08:38 -06:00
Dario Nieuwenhuis
57eabb372e
Merge pull request #31 from xoviat/interrupt-signal
add InterruptSignal
2021-01-21 18:04:13 +01:00
xoviat
e0183f4495 optimize interruptfuture
remove critical secitons, impl. Unpin
2021-01-21 10:59:14 -06:00
xoviat
6503f9dbf5 implement interruptfuture
converts an interrupt to a future
2021-01-21 10:22:30 -06:00
Dario Nieuwenhuis
27831124a7 Remove unused rtic dep 2021-01-21 01:07:04 +01:00
Dario Nieuwenhuis
5b897b6605 executor: Add 'raw' api to wake tasks through raw pointers. 2021-01-21 01:00:12 +01:00
Dario Nieuwenhuis
28b5d8e9f4
Merge pull request #26 from timokroeger/fix-irq-nr
Fix IRQ numbers
2021-01-17 18:52:43 +01:00
Timo Kröger
9f9d808948 Fix IRQ numbers
The raw enum values are not always equal to the interrupt number
fixes #23
2021-01-17 17:28:46 +01:00
Dario Nieuwenhuis
4e789c663c
Merge pull request #15 from akiles/gpio-wait
RFC: GPIO WaitForFoo traits
2021-01-15 23:06:07 +01:00
Dario Nieuwenhuis
28fe29fff3
Merge pull request #22 from xoviat/cleanup
minor cleanup to interface
2021-01-14 19:02:00 +01:00
xoviat
2b15a2674f minor cleanup to interface 2021-01-14 11:42:23 -06:00