cortex-m
cortex-m copied to clipboard
Fixed VectActive::from() returning incorrect value
Fixes #499
Fixed VectActive::from(u8)
now returns correct value for Interrupt variant
Refactored SCB::vect_active()
to use VectActive::from(u8)
and get rid of code duplication
Can you rebase this? The CI failure is from an old MSRV
@newAM, Could you please explain a little more? I forked the repo and made this commit from the v0.7.x branch.
Oh, sorry, I didn't see that this was targeting v0.7.x
! That makes more sense then. The problem is that serde_json
isn't pinned, and the latest version requires edition 2021. I think specifying >=1.00,<=1.0.100
for serde_json
should fix the build failure.
Oh, unwrap_unchecked
seems to not be available on rustc version 1.38.0
. It forces me to write a reaction to the case, when icsr register returns unexpected value. Is panic appropriate in this case? Or maybe we should execute udf
instruction?
Assuming correct implementation for VectActive::from
for all cortex-m processors, this problem can only appear when incorrect target was selected by user, and it is impossible to check this in compile time.
Adding these ugly lines in Cargo.toml to fix deps versions did help compiling on 1.38
Or should we better just bump MSRV to 1.60?
cortex-m-rt says:
This crate is guaranteed to compile on stable Rust 1.59.0 and up
But this is cortex-m, not cortex-m-rt latest update 0.7.7 was published 1 year ago
From v0.7.x branch Readme: https://github.com/rust-embedded/cortex-m/blob/bb4a78208323260a161e68b2498438867f971bc5/README.md?plain=1#L14
But how many people use cortex-m without using cortex-m-rt?
cortex-m has twice as many downloads compared to cortex-m-rt It seems that there isn't much sense in supporting these old versions of the Rust compiler. Moreover, a significant portion of people even uses Nightly.
Should I bump the MSRV to 1.60 and remove fixed dependency versions?
1.59 makes sense, so they are the same.
unwrap_unchecked first appeared in 1.58 so that's fine.