Commit Graph

24 Commits

Author SHA1 Message Date
a5ad79927e nrf: add Unborrow<Target = Self> bound to all instance traits 2021-05-17 01:01:31 +02:00
7fa0e57172 Use critical_section crate 2021-05-11 01:15:30 +02:00
b9e709403d nrf: better macro naming. 2021-03-29 00:58:58 +02:00
5646926cca nrf/rtc: update to new api 2021-03-29 00:58:58 +02:00
45355f184a move most interrupt methods to InterruptExt extension trait. Fixes #35 2021-03-01 00:44:38 +01:00
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
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
91aaea761e Use Relaxed atomics with fence instead of SeqCst 2021-02-20 01:43:10 +01:00
406f3b7cbf rtc: use SeqCst for periods. 2021-02-15 01:23:15 +01:00
9d5e2d3881 SImplify rtc overflow handling 2021-02-15 01:01:45 +01:00
b69f72e055 Get rid of some warnings 2021-02-13 21:41:36 -03:00
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
6963b314a2 nrf/rtc: fix race when setting alarms too close to now. 2021-01-13 03:17:58 +01:00
5229a1991c nrf/rtc: use interrupt handler context for instance ptr 2021-01-13 03:17:42 +01:00
9e88718fbd Add "context" pointer to owned interrupt handlers. 2021-01-04 22:25:39 +01:00
4b8d8ba87e Update RTC for owned irqs 2020-12-29 01:05:28 +01:00
0643095695 Fix build with all nrf chip models 2020-10-31 23:03:09 +01:00
37d2b440ff Fix rtc using multiple alarms at the same time. 2020-09-26 00:35:25 +02:00
19a89b5c14 Add Clock trait 2020-09-25 23:38:42 +02:00
cf1d604749 Add support for multi alarm to RTC. 2020-09-25 23:25:49 +02:00
4333105341 Add Executor with timer queue, Timer, Instant, Duration, Alarm. 2020-09-25 03:25:06 +02:00
05ca563e7d Add clock::Monotonic trait. 2020-09-24 23:26:24 +02:00
82e5e3c45f rtc: Add alarm callback. 2020-09-24 22:41:52 +02:00
3b39ab07e5 Add 64-bit rtc driver with alarm support. 2020-09-24 19:59:20 +02:00