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/).
1111
1212- MonoTimer now takes ownership of the DCB register
1313- SPI objects now have a ` FrameSize ` type field
14+ - Bit banding functions (` bb::* ` ) are now correctly marked as unsafe
1415
1516### Added
1617
1718- Add 16 bit dataframe size for ` SPI `
1819- Implement ` timer::Cancel ` trait for ` CountDownTimer `
1920- Changing Output pin slew rates through the OutputSpeed trait
20-
21- ### Added
22-
2321- Add support for ADC continuous conversion
2422- Add supoort for ADC discontinuous mode
2523
Original file line number Diff line number Diff line change 22
33use core:: ptr;
44
5- pub fn clear < T > ( register : * const T , bit : u8 ) {
5+ pub unsafe fn clear < T > ( register : * const T , bit : u8 ) {
66 write ( register, bit, false ) ;
77}
88
9- pub fn set < T > ( register : * const T , bit : u8 ) {
9+ pub unsafe fn set < T > ( register : * const T , bit : u8 ) {
1010 write ( register, bit, true ) ;
1111}
1212
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 ) {
1414 let addr = register as usize ;
1515
1616 assert ! ( addr >= 0x4000_0000 && addr <= 0x4010_0000 ) ;
1717 assert ! ( bit < 32 ) ;
1818
1919 let bit = bit as usize ;
2020 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 } )
2222}
You can’t perform that action at this time.
0 commit comments