File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ impl<'a> FlashWriter<'a> {
112112 }
113113
114114 fn valid_length ( & self , offset : u32 , length : usize ) -> Result < ( ) > {
115- if offset + length as u32 > self . flash_sz . kbytes ( ) as u32 {
115+ if offset + length as u32 > self . flash_sz . kbytes ( ) {
116116 Err ( Error :: LengthTooLong )
117117 } else if length & 0x1 != 0 {
118118 Err ( Error :: LengthNotMultiple2 )
@@ -178,7 +178,7 @@ impl<'a> FlashWriter<'a> {
178178 let size = self . sector_sz . kbytes ( ) as u32 ;
179179 let start = start_offset & !( size - 1 ) ;
180180 for idx in ( start..start + size) . step_by ( 2 ) {
181- let write_address = ( FLASH_START + idx as u32 ) as * const u16 ;
181+ let write_address = ( FLASH_START + idx) as * const u16 ;
182182 let verify: u16 = unsafe { core:: ptr:: read_volatile ( write_address) } ;
183183 if verify != 0xFFFF {
184184 return Err ( Error :: VerifyError ) ;
@@ -209,7 +209,7 @@ impl<'a> FlashWriter<'a> {
209209 pub fn read ( & self , offset : u32 , length : usize ) -> Result < & [ u8 ] > {
210210 self . valid_address ( offset) ?;
211211
212- if offset + length as u32 > self . flash_sz . kbytes ( ) as u32 {
212+ if offset + length as u32 > self . flash_sz . kbytes ( ) {
213213 return Err ( Error :: LengthTooLong ) ;
214214 }
215215
Original file line number Diff line number Diff line change @@ -125,6 +125,9 @@ pub trait GpioExt {
125125 fn split ( self ) -> Self :: Parts ;
126126
127127 /// Splits the GPIO block into independent pins and registers without resetting its state.
128+ ///
129+ /// # Safety
130+ /// Make sure that all pins modes are set in reset state.
128131 unsafe fn split_without_reset ( self ) -> Self :: Parts ;
129132}
130133
You can’t perform that action at this time.
0 commit comments