File tree 2 files changed +8
-8
lines changed
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ pub use bare_metal::{CriticalSection, Mutex};
16
16
/// and must always return the same value (do not change at runtime).
17
17
///
18
18
/// These requirements ensure safe nesting of critical sections.
19
- pub unsafe trait InterruptNumber : Into < u16 > { }
19
+ pub unsafe trait InterruptNumber : Into < u16 > + Copy { }
20
20
21
21
/// Disables all interrupts
22
22
#[ inline]
Original file line number Diff line number Diff line change @@ -139,8 +139,8 @@ impl NVIC {
139
139
#[ cfg( armv6m) ]
140
140
{
141
141
// NOTE(unsafe) atomic read with no side effects
142
- let ipr_n = unsafe { ( * Self :: ptr ( ) ) . ipr [ Self :: ipr_index ( & interrupt) ] . read ( ) } ;
143
- let prio = ( ipr_n >> Self :: ipr_shift ( & interrupt) ) & 0x0000_00ff ;
142
+ let ipr_n = unsafe { ( * Self :: ptr ( ) ) . ipr [ Self :: ipr_index ( interrupt) ] . read ( ) } ;
143
+ let prio = ( ipr_n >> Self :: ipr_shift ( interrupt) ) & 0x0000_00ff ;
144
144
prio as u8
145
145
}
146
146
}
@@ -222,9 +222,9 @@ impl NVIC {
222
222
223
223
#[ cfg( armv6m) ]
224
224
{
225
- self . ipr [ Self :: ipr_index ( & interrupt) ] . modify ( |value| {
226
- let mask = 0x0000_00ff << Self :: ipr_shift ( & interrupt) ;
227
- let prio = u32:: from ( prio) << Self :: ipr_shift ( & interrupt) ;
225
+ self . ipr [ Self :: ipr_index ( interrupt) ] . modify ( |value| {
226
+ let mask = 0x0000_00ff << Self :: ipr_shift ( interrupt) ;
227
+ let prio = u32:: from ( prio) << Self :: ipr_shift ( interrupt) ;
228
228
229
229
( value & !mask) | prio
230
230
} )
@@ -245,7 +245,7 @@ impl NVIC {
245
245
246
246
#[ cfg( armv6m) ]
247
247
#[ inline]
248
- fn ipr_index < I > ( interrupt : & I ) -> usize
248
+ fn ipr_index < I > ( interrupt : I ) -> usize
249
249
where
250
250
I : InterruptNumber ,
251
251
{
@@ -254,7 +254,7 @@ impl NVIC {
254
254
255
255
#[ cfg( armv6m) ]
256
256
#[ inline]
257
- fn ipr_shift < I > ( interrupt : & I ) -> usize
257
+ fn ipr_shift < I > ( interrupt : I ) -> usize
258
258
where
259
259
I : InterruptNumber ,
260
260
{
You can’t perform that action at this time.
0 commit comments