File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
11
11
12
12
- MonoTimer now takes ownership of the DCB register
13
13
- SPI objects now have a ` FrameSize ` type field
14
+ - Bit banding functions (` bb::* ` ) are now correctly marked as unsafe
14
15
15
16
### Added
16
17
17
18
- Add 16 bit dataframe size for ` SPI `
18
19
- Implement ` timer::Cancel ` trait for ` CountDownTimer `
19
20
- Changing Output pin slew rates through the OutputSpeed trait
20
-
21
- ### Added
22
-
23
21
- Add support for ADC continuous conversion
24
22
- Add supoort for ADC discontinuous mode
25
23
Original file line number Diff line number Diff line change 2
2
3
3
use core:: ptr;
4
4
5
- pub fn clear < T > ( register : * const T , bit : u8 ) {
5
+ pub unsafe fn clear < T > ( register : * const T , bit : u8 ) {
6
6
write ( register, bit, false ) ;
7
7
}
8
8
9
- pub fn set < T > ( register : * const T , bit : u8 ) {
9
+ pub unsafe fn set < T > ( register : * const T , bit : u8 ) {
10
10
write ( register, bit, true ) ;
11
11
}
12
12
13
- pub fn write < T > ( register : * const T , bit : u8 , set : bool ) {
13
+ pub unsafe fn write < T > ( register : * const T , bit : u8 , set : bool ) {
14
14
let addr = register as usize ;
15
15
16
16
assert ! ( addr >= 0x4000_0000 && addr <= 0x4010_0000 ) ;
17
17
assert ! ( bit < 32 ) ;
18
18
19
19
let bit = bit as usize ;
20
20
let bb_addr = ( 0x4200_0000 + ( addr - 0x4000_0000 ) * 32 ) + 4 * bit;
21
- unsafe { ptr:: write_volatile ( bb_addr as * mut u32 , if set { 1 } else { 0 } ) }
21
+ ptr:: write_volatile ( bb_addr as * mut u32 , if set { 1 } else { 0 } )
22
22
}
You can’t perform that action at this time.
0 commit comments