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> {
112
112
}
113
113
114
114
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 ( ) {
116
116
Err ( Error :: LengthTooLong )
117
117
} else if length & 0x1 != 0 {
118
118
Err ( Error :: LengthNotMultiple2 )
@@ -178,7 +178,7 @@ impl<'a> FlashWriter<'a> {
178
178
let size = self . sector_sz . kbytes ( ) as u32 ;
179
179
let start = start_offset & !( size - 1 ) ;
180
180
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 ;
182
182
let verify: u16 = unsafe { core:: ptr:: read_volatile ( write_address) } ;
183
183
if verify != 0xFFFF {
184
184
return Err ( Error :: VerifyError ) ;
@@ -209,7 +209,7 @@ impl<'a> FlashWriter<'a> {
209
209
pub fn read ( & self , offset : u32 , length : usize ) -> Result < & [ u8 ] > {
210
210
self . valid_address ( offset) ?;
211
211
212
- if offset + length as u32 > self . flash_sz . kbytes ( ) as u32 {
212
+ if offset + length as u32 > self . flash_sz . kbytes ( ) {
213
213
return Err ( Error :: LengthTooLong ) ;
214
214
}
215
215
Original file line number Diff line number Diff line change @@ -125,6 +125,9 @@ pub trait GpioExt {
125
125
fn split ( self ) -> Self :: Parts ;
126
126
127
127
/// 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.
128
131
unsafe fn split_without_reset ( self ) -> Self :: Parts ;
129
132
}
130
133
You can’t perform that action at this time.
0 commit comments