diff options
author | 2020-07-28 00:03:51 +0000 | |
---|---|---|
committer | 2020-07-28 00:03:51 +0000 | |
commit | f0d1ed4aec18c84437ead373ac6509a43f49cd43 (patch) | |
tree | 031a71a53041c5ba81e23b348466c064b7d054a4 /check-blobs.sh | |
parent | 9dee813277e200f431d0f63522fafe327cdb5034 (diff) | |
parent | 68ec03968db76f1b5de888174495389490e798e8 (diff) | |
download | cortex-m-f0d1ed4aec18c84437ead373ac6509a43f49cd43.tar.gz cortex-m-f0d1ed4aec18c84437ead373ac6509a43f49cd43.tar.zst cortex-m-f0d1ed4aec18c84437ead373ac6509a43f49cd43.zip |
Merge #235
235: make 'fn ptr()' APIs to be 'const fn ptr()' r=therealprof a=JOE1994
This PR changes functions like `ITM::ptr()`, `DWT::ptr()` to become `const fn`s.
* functions like `ITM::ptr()`, `DWT::ptr()` return pointers that are cast from constants,
but currently these functions can't be used to define a constant. This PR will allow below code to compile.
```rust
use cortex_m::peripheral::ITM;
use cortex_m::peripheral::itm::RegisterBlock;
// Below line currently won't compile, since `ITM::ptr()` is not a `const fn`
const ITM_PTR: *mut RegisterBlock = ITM::ptr();
```
I couldn't think of disadvantages that might accompany this change, but please correct me if I'm wrong.
Thank you for reviewing this PR :+1:
Co-authored-by: JOE1994 <joseph942010@gmail.com>
Co-authored-by: Youngsuk Kim <joseph942010@gmail.com>
Diffstat (limited to 'check-blobs.sh')
0 files changed, 0 insertions, 0 deletions