Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cortex-m/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Removed
- The separate `#[cfg(not(cortex_m))]` stub for `interrupt::free`. The real
`free` already compiles on non-Cortex-M targets on its own (it only calls
functions that fall back to `unimplemented!()` off-target), so the stub was
dead weight.

### Fixed
- `NVIC`'s interrupt-bitmap accessors no longer emit a bounds check and a panic
path.
Expand Down
15 changes: 0 additions & 15 deletions cortex-m/src/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ pub unsafe fn enable() {
/// Execute closure `f` in an interrupt-free context.
///
/// This as also known as a "critical section".
#[cfg(cortex_m)]
#[inline]
pub fn free<F, R>(f: F) -> R
where
Expand All @@ -86,17 +85,3 @@ where

r
}

// Make a `free()` function available on hosted platforms to allow checking dependencies without
// specifying a target, but that will panic at runtime if executed.
/// Execute closure `f` in an interrupt-free context.
///
/// This as also known as a "critical section".
#[cfg(not(cortex_m))]
#[inline]
pub fn free<F, R>(_: F) -> R
where
F: FnOnce(&CriticalSection) -> R,
{
panic!("cortex_m::interrupt::free() is only functional on cortex-m platforms");
}