Skip to content

Commit 22d47dd

Browse files
Merge #191
191: Remove deprecated APIs and the `const-fn` feature r=adamgreig a=jonas-schievink Co-authored-by: Jonas Schievink <[email protected]>
2 parents 465c64d + ab8d463 commit 22d47dd

File tree

4 files changed

+4
-88
lines changed

4 files changed

+4
-88
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,5 @@ bare-metal = { version = "0.2.0", features = ["const-fn"] }
2020
volatile-register = "0.2.0"
2121

2222
[features]
23-
const-fn = []
2423
cm7-r0p1 = []
2524
inline-asm = []

src/peripheral/nvic.rs

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ pub struct RegisterBlock {
3838

3939
_reserved5: [u32; 48],
4040

41-
#[cfg(not(armv6m))]
4241
/// Interrupt Priority
4342
///
4443
/// On ARMv7-M, 124 word-sized registers are available. Each of those
@@ -50,9 +49,9 @@ pub struct RegisterBlock {
5049
/// On ARMv6-M, the registers must only be accessed along word boundaries,
5150
/// so convenient byte-sized representation wouldn't work on that
5251
/// architecture.
52+
#[cfg(not(armv6m))]
5353
pub ipr: [RW<u8>; 496],
5454

55-
#[cfg(armv6m)]
5655
/// Interrupt Priority
5756
///
5857
/// On ARMv7-M, 124 word-sized registers are available. Each of those
@@ -64,25 +63,26 @@ pub struct RegisterBlock {
6463
/// On ARMv6-M, the registers must only be accessed along word boundaries,
6564
/// so convenient byte-sized representation wouldn't work on that
6665
/// architecture.
66+
#[cfg(armv6m)]
6767
pub ipr: [RW<u32>; 8],
6868

6969
#[cfg(not(armv6m))]
7070
_reserved6: [u32; 580],
7171

72-
#[cfg(not(armv6m))]
7372
/// Software Trigger Interrupt
73+
#[cfg(not(armv6m))]
7474
pub stir: WO<u32>,
7575
}
7676

7777
impl NVIC {
78-
#[cfg(not(armv6m))]
7978
/// Request an IRQ in software
8079
///
8180
/// Writing a value to the INTID field is the same as manually pending an interrupt by setting
8281
/// the corresponding interrupt bit in an Interrupt Set Pending Register. This is similar to
8382
/// `set_pending`.
8483
///
8584
/// This method is not available on ARMv6-M chips.
85+
#[cfg(not(armv6m))]
8686
#[inline]
8787
pub fn request<I>(&mut self, interrupt: I)
8888
where
@@ -95,16 +95,6 @@ impl NVIC {
9595
}
9696
}
9797

98-
/// Clears `interrupt`'s pending state
99-
#[deprecated(since = "0.5.8", note = "Use `NVIC::unpend`")]
100-
#[inline]
101-
pub fn clear_pending<I>(&mut self, interrupt: I)
102-
where
103-
I: Nr,
104-
{
105-
Self::unpend(interrupt)
106-
}
107-
10898
/// Disables `interrupt`
10999
#[inline]
110100
pub fn mask<I>(interrupt: I)
@@ -129,27 +119,6 @@ impl NVIC {
129119
(*Self::ptr()).iser[usize::from(nr / 32)].write(1 << (nr % 32))
130120
}
131121

132-
/// Disables `interrupt`
133-
#[deprecated(since = "0.6.1", note = "Use `NVIC::mask`")]
134-
#[inline]
135-
pub fn disable<I>(&mut self, interrupt: I)
136-
where
137-
I: Nr,
138-
{
139-
Self::mask(interrupt)
140-
}
141-
142-
/// **WARNING** This method is a soundness hole in the API; it should actually be an `unsafe`
143-
/// function. Use `NVIC::unmask` which has the right unsafety.
144-
#[deprecated(since = "0.6.1", note = "Use `NVIC::unmask`")]
145-
#[inline]
146-
pub fn enable<I>(&mut self, interrupt: I)
147-
where
148-
I: Nr,
149-
{
150-
unsafe { Self::unmask(interrupt) }
151-
}
152-
153122
/// Returns the NVIC priority of `interrupt`
154123
///
155124
/// *NOTE* NVIC encodes priority in the highest bits of a byte so values like `1` and `2` map
@@ -228,16 +197,6 @@ impl NVIC {
228197
unsafe { (*Self::ptr()).ispr[usize::from(nr / 32)].write(1 << (nr % 32)) }
229198
}
230199

231-
/// Forces `interrupt` into pending state
232-
#[deprecated(since = "0.5.8", note = "Use `NVIC::pend`")]
233-
#[inline]
234-
pub fn set_pending<I>(&mut self, interrupt: I)
235-
where
236-
I: Nr,
237-
{
238-
Self::pend(interrupt)
239-
}
240-
241200
/// Sets the "priority" of `interrupt` to `prio`
242201
///
243202
/// *NOTE* See [`get_priority`](struct.NVIC.html#method.get_priority) method for an explanation

src/peripheral/scb.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -633,27 +633,6 @@ const SCB_AIRCR_PRIGROUP_MASK: u32 = 0x5 << 8;
633633
const SCB_AIRCR_SYSRESETREQ: u32 = 1 << 2;
634634

635635
impl SCB {
636-
/// Initiate a system reset request to reset the MCU
637-
#[deprecated(since = "0.6.1", note = "Use `SCB::sys_reset`")]
638-
#[inline]
639-
pub fn system_reset(&mut self) -> ! {
640-
crate::asm::dsb();
641-
unsafe {
642-
self.aircr.modify(
643-
|r| {
644-
SCB_AIRCR_VECTKEY | // otherwise the write is ignored
645-
r & SCB_AIRCR_PRIGROUP_MASK | // keep priority group unchanged
646-
SCB_AIRCR_SYSRESETREQ
647-
}, // set the bit
648-
)
649-
};
650-
crate::asm::dsb();
651-
loop {
652-
// wait for the reset
653-
crate::asm::nop(); // avoid rust-lang/rust#28728
654-
}
655-
}
656-
657636
/// Initiate a system reset request to reset the MCU
658637
#[inline]
659638
pub fn sys_reset() -> ! {

src/register/mod.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,35 +29,14 @@
2929
#[cfg(all(not(armv6m), not(armv8m_base)))]
3030
pub mod basepri;
3131

32-
#[cfg(armv8m_base)]
33-
#[deprecated(
34-
since = "0.6.2",
35-
note = "basepri is unavailable on thumbv8.base, and will be removed in the next release"
36-
)]
37-
pub mod basepri;
38-
3932
#[cfg(all(not(armv6m), not(armv8m_base)))]
4033
pub mod basepri_max;
4134

42-
#[cfg(armv8m_base)]
43-
#[deprecated(
44-
since = "0.6.2",
45-
note = "basepri is unavailable on thumbv8m.base, and will be removed in the next release"
46-
)]
47-
pub mod basepri_max;
48-
4935
pub mod control;
5036

5137
#[cfg(all(not(armv6m), not(armv8m_base)))]
5238
pub mod faultmask;
5339

54-
#[cfg(armv8m_base)]
55-
#[deprecated(
56-
since = "0.6.2",
57-
note = "faultmask is unavailable on thumbv8m.base, and will be removed in the next release"
58-
)]
59-
pub mod faultmask;
60-
6140
pub mod msp;
6241

6342
pub mod primask;

0 commit comments

Comments
 (0)