Commit graph

196 commits

Author SHA1 Message Date
Per Lindgren
1e2ab78a3f added doc for RacyCell 2021-11-02 19:47:14 +01:00
Emil Fresk
8065d741ac Fixed aliasing issue due to RacyCell implementation 2021-11-02 13:41:12 +01:00
Emil Fresk
7c6588e6bd Fix export of SYST 2021-09-28 10:38:22 +02:00
Emil Fresk
cdab00a0c6 Fix a bug in the timer queue due to comparison bug in embedded-time 2021-09-27 15:39:05 +02:00
Emil Fresk
addb086070 Cleanup export and actually use rtic::export, made fn init inline 2021-09-14 16:13:28 +02:00
Emil Fresk
bc3eb5c547 Remove linked list impl - use heapless, linked list init now const fn 2021-08-16 15:38:31 +02:00
Andrey Zgarbul
e4319de3d5 const generics 2021-07-09 18:44:19 +03:00
James Hillyerd
87c958da3b assert empty 2021-06-06 15:00:52 -07:00
James Hillyerd
064ff239f3 Allow zero sized LinkedList 2021-06-06 14:56:00 -07:00
Emil Fresk
6aa0fb450f Goodbye static mut 2021-04-08 19:58:20 +02:00
Emil Fresk
51500a1d70 Fixed UB in spawn_at 2021-04-08 10:14:14 +02:00
Emil Fresk
3adda3c766 Updated schedule example with all combinations 2021-03-22 08:24:18 +01:00
Emil Fresk
53c407017f Cancel and reschedule working
Support cfgs in the imports

Account for extern tasks
2021-03-20 08:19:56 +01:00
Emil Fresk
1087f2ee64 Added interface for cancel/reschedule
Use wrapping add for marker

No need to store handle to queue

Remove unnecessary `SpawnHandle::new`

Fix test

Updated interface to follow proposal
2021-03-13 10:50:56 +01:00
Emil Fresk
767d46e05b Review fixes 2021-02-25 17:32:12 +01:00
Emil Fresk
56d99c02bd Updated to new interface 2021-02-22 20:59:23 +01:00
Emil Fresk
82d051e8e9 Added enable/disable timer calls 2021-02-22 20:59:03 +01:00
Emil Fresk
e52088bbd8 Of by 1 2021-02-22 20:15:13 +01:00
Emil Fresk
ebf2f058a4 Now with new monotonic trait and crate 2021-02-18 19:30:59 +01:00
Emil Fresk
b57ef0bf9d Merge branch 'master' into new_monotonic 2021-02-06 21:34:16 +01:00
Emil Fresk
0658d53843 cleanup 2021-01-10 15:47:25 +01:00
Nicolas Stalder
aa90cb1484 Bump cortex-m to 0.7.0 2021-01-04 16:07:17 +01:00
Emil Fresk
aaa92ea2fa Cleanup 2020-12-13 17:48:11 +01:00
Emil Fresk
0e134a41b5 Double check the compare instant 2020-12-13 14:20:28 +01:00
Emil Fresk
dd52539e32 Less ... hacky? 2020-12-13 00:09:44 +01:00
Emil Fresk
35b4ec0d04 Reexport embedded-time as rtic::time 2020-12-13 00:06:50 +01:00
Emil Fresk
8e8ec9b7b8 Monotonic codegen now passing compile stage 2020-12-12 23:24:54 +01:00
Emil Fresk
97a48983d2 More work 2020-12-10 20:33:13 +01:00
Emil Fresk
b23bb1192c TQ handlers being generated 2020-12-08 20:49:13 +01:00
Emil Fresk
ef50aeb2e8 Save, init generation fixed 2020-12-03 21:04:06 +01:00
Emil Fresk
3b4c10e790 Removed monotonic trait, moved to rtic-core 2020-12-03 18:25:54 +01:00
Emil Fresk
400df08ac7 Removed cortex-m-rt 2020-11-26 17:51:25 +01:00
Emil Fresk
d079949139 Add multilock to the book 2020-11-14 16:13:00 +01:00
Emil Fresk
243668df54 Multilock support 2020-11-14 16:02:36 +01:00
Henrik Tjäder
21253297e4 Implement all clippy suggestions 2020-10-15 17:09:27 +00:00
Henrik Tjäder
5082f70e5e Remove exports related to heterogeneous multi-core support 2020-10-01 19:13:22 +00:00
Emil Fresk
fb61a78cdd Added bare_metal::CriticalSection to init::Context 2020-10-01 20:01:25 +02:00
Henrik Tjäder
d06cf91acc Remove stale code, fix comment styling 2020-09-01 17:48:53 +00:00
Henrik Tjäder
76cf14c520 Brutally yank out multicore 2020-09-01 14:50:06 +00: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
Jorge Aparicio
303e964a10 touch src/lib.rs 2020-05-26 22:16:31 +02:00
bors[bot]
03ac76a0a2
Merge #295
295: docs: do not use Instant::now in #[init] r=korken89 a=japaric



Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2020-01-24 15:14:58 +00:00
Jorge Aparicio
b04103f6df docs: do not use Instant::now in #[init] 2020-01-21 22:23:20 +01:00
bors[bot]
82efffd706
Merge #277
277: TimerQueue.dequeue: don't set SYST reload to 0 r=korken89 a=mpasternacki

ARM Architecture Reference Manual says: "Setting SYST_RVR to zero has the effect of disabling the SysTick counter independently of the counter enable bit."

If Monotonic's ratio is less than one, the timeout calculations
can compute zero if next task is scheduled after current instant, but
before next timer tick. This results in disabling SYST and freezing the
timer queue.

The division by ratio's denominator rounds downward and the dequeue
condition is `if instant < now`. If ratio is small enough, this results
in unnecessary interrupts:

Let's say `instant - now` is 99 and ratio is 1/25. Then, `dur` will
equal 3 and the next tick will happen at `now + 75`. In the next
interrupt, `instant > now` and additional tick needs to be scheduled
(which doesn't happen, because now `instant - now` is less than 25, so
reload will be set to 0 and timer queue will stop). Adding one to
computed duration will prevent both freezing and additional interrupts.

When ratio is 1 or close, timer queue code overhead will prevent this
from happening. I am working with a chip where CPU is clocked at 600MHz
and SysTick is 100kHz and the freeze happens quite often.

Co-authored-by: Maciej Pasternacki <maciej@3ofcoins.net>
2019-11-19 14:00:22 +00:00
Maciej Pasternacki
fef738e832 TimerQueue.dequeue: don't set SYST reload to 0
ARM Architecture Reference Manual says: "Setting SYST_RVR to zero has the effect of disabling the SysTick counter independently of the counter enable bit."

If Monotonic's ratio is less than one, the timeout calculations
can compute zero if next task is scheduled after current instant, but
before next timer tick. This results in disabling SYST and freezing the
timer queue.
2019-11-19 00:07:14 +01:00
Per Lindgren
dfab15ed78 Fixed internal overflow on subtraiton in elapsed and duration 2019-11-18 16:36:17 +01:00
Emil Fresk
2441b7e389 Minor docs update to monotonic 2019-11-13 21:19:59 +01:00
Jorge Aparicio
a458a07031 cyccnt::Instant: simplify the Send / Sync impl
originally the type was made `!Send` because it loses its meaning when
send from one core to another but that was an incorrect use of the `Send`
bound (the send operation makes the value incorrect but that doesn't cause
memory unsafety on its own). So later the type was (explicitly) made `Send`
again resulting in a convoluted implementation -- this commit simplifies things.
2019-10-15 19:31:46 -05:00
Jorge Aparicio
6207008884 document the limitations of cyccnt::{Instant,Duration} 2019-10-15 19:11:35 -05:00