Commit graph

21 commits

Author SHA1 Message Date
Emil Fresk
c40c89bb4e Clippy fixes 2023-03-01 00:33:29 +01:00
David Watson
368ab1d4fb Remove use of basepri register on thumbv8m.base
The basepri register appears to be aviable on thumbv8m.main but not
thumbv8m.base. At the very least, attempting to compile against a
Cortex-M23 based Microchip ATSAML10E16A generates an error:

```
error[E0432]: unresolved import `cortex_m::register::basepri`
  --> /Users/dwatson/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rtic-1.1.3/src/export.rs:25:5
   |
25 | use cortex_m::register::basepri;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `basepri` in `register`
```

This is an attempt to account for the fact that thumbv8m.base (M23)
MCUs don't have the BASEPRI register but have more than 32
interrupts. This moves away from the architecture specific config
flags and switches to a more functional flag.

Make the mask size depend on the max interrupt id

Rather than assuming a fixed interrupt count of 32 this code uses an
array of u32 bitmasks to calculate the priority mask. The size of this
array is calculated at compile time based on the size of the largest
interrupt id being used in the target code. For thumbv6m this should
be equivalent to the previous version that used a single u32 mask. For
thumbv8m.base it will be larger depending on the interrupts used.

Don't write 0s to the ISER and ICER registers

Writing 0s to these registers is a no-op. Since these masks should be
calculated at compile time, this conditional should result in writes
being optimized out of the code.

Prevent panic on non-arm targets

Panicking on unknown targets was breaking things like the doc build on
linux. This change should only panic when building on unknown arm
targets.
2022-07-27 21:04:24 +02:00
Henrik Tjäder
5ed93bd1bf Clippy with pedantic suggestions 2022-02-22 18:56:21 +01:00
Henrik Tjäder
21253297e4 Implement all clippy suggestions 2020-10-15 17:09:27 +00:00
Henrik Tjäder
fca678b874 Use buildrs for conditional compilation 2020-04-20 16:03:49 +00:00
Jorge Aparicio
be92041a59 WIP 2019-06-29 09:11:57 +02:00
Jorge Aparicio
06c1e2f9b4 note that the timer queue is not supported on ARMv6-M 2018-12-16 19:38:22 +01:00
Jorge Aparicio
c631049efc v0.4.0
closes #32
closes #33
2018-11-03 17:16:55 +01:00
Jorge Aparicio
86a360a396 rtfm! macro take 2 2017-07-04 11:26:11 -05:00
Jorge Aparicio
acdfa6f09d drop the Ceiling newtype
it's not required as the user never deal with Ceiling tokens
2017-05-08 13:27:29 -05:00
Jorge Aparicio
fc4cb7d472 replace the ceiling token with a preemption threshold token 2017-05-08 12:05:42 -05:00
Jorge Aparicio
ec2df608ca make as_ceiling a general method of P<N> 2017-04-27 18:34:21 -05:00
Jorge Aparicio
4992db7877 more docs, remove Ceiling / Priority / Level traits 2017-04-21 00:24:54 -05:00
Jorge Aparicio
4e6818eb2c remove claim, add Priority.as_ceiling 2017-04-19 17:21:13 -05:00
Jorge Aparicio
c6bf89a318 remove unnecessary trait bounds 2017-04-14 00:33:07 -05:00
Jorge Aparicio
bf17ee7422 pass P0 to init, derive GreaterThanOrEqual for U0 2017-04-14 00:15:49 -05:00
Jorge Aparicio
398a5ebc5c add critical, a global critical section 2017-04-13 23:52:02 -05:00
Jorge Aparicio
26f8ca6969 rustfmt 2017-04-12 15:28:18 -05:00
Jorge Aparicio
5d6847ab7b partial thumv6m-none-eabi support 2017-04-11 23:19:18 -05:00
Jorge Aparicio
595404c5ff compile time verified ceilings 2017-04-09 22:42:17 -05:00
Jorge Aparicio
e631d8513a partial thumbv6m-none-eabi support 2017-04-06 14:06:33 -05:00