File tree 2 files changed +21
-21
lines changed
2 files changed +21
-21
lines changed Original file line number Diff line number Diff line change @@ -172,12 +172,15 @@ impl<'a> EraseSequence<'a> {
172
172
//TODO: This should check if sector_number is valid for this device
173
173
174
174
flash. registers . cr . modify ( |_, w| unsafe {
175
- w. mer ( )
176
- . clear_bit ( )
177
- . ser ( )
178
- . set_bit ( )
179
- . snb ( )
180
- . bits ( sector_number)
175
+ #[ cfg( any( feature = "svd-f7x6" , feature = "svd-f7x7" , feature = "svd-f7x9" ) ) ]
176
+ w
177
+ . mer1 ( ) . clear_bit ( )
178
+ . mer2 ( ) . clear_bit ( ) ;
179
+ #[ cfg( not( any( feature = "svd-f7x6" , feature = "svd-f7x7" , feature = "svd-f7x9" ) ) ) ]
180
+ w. mer ( ) . clear_bit ( ) ;
181
+ w
182
+ . ser ( ) . set_bit ( )
183
+ . snb ( ) . bits ( sector_number)
181
184
} ) ;
182
185
flash. registers . cr . modify ( |_, w| w. strt ( ) . start ( ) ) ;
183
186
@@ -189,10 +192,17 @@ impl<'a> EraseSequence<'a> {
189
192
flash. check_locked_or_busy ( ) ?;
190
193
flash. clear_errors ( ) ;
191
194
192
- flash
193
- . registers
194
- . cr
195
- . modify ( |_, w| w. mer ( ) . set_bit ( ) . ser ( ) . clear_bit ( ) ) ;
195
+ flash. registers . cr . modify ( |_, w| unsafe {
196
+ #[ cfg( any( feature = "svd-f7x6" , feature = "svd-f7x7" , feature = "svd-f7x9" ) ) ]
197
+ w
198
+ . mer1 ( ) . set_bit ( )
199
+ . mer2 ( ) . set_bit ( ) ;
200
+ #[ cfg( not( any( feature = "svd-f7x6" , feature = "svd-f7x7" , feature = "svd-f7x9" ) ) ) ]
201
+ w. mer ( ) . clear_bit ( ) ;
202
+ w
203
+ . ser ( ) . clear_bit ( )
204
+ } ) ;
205
+
196
206
flash. registers . cr . modify ( |_, w| w. strt ( ) . start ( ) ) ;
197
207
198
208
Ok ( Self { flash } )
Original file line number Diff line number Diff line change @@ -160,17 +160,7 @@ pub mod qei;
160
160
#[ cfg( feature = "ltdc" ) ]
161
161
pub mod ltdc;
162
162
163
- #[ cfg( all(
164
- feature = "device-selected" ,
165
- not( any(
166
- feature = "stm32f765" ,
167
- feature = "stm32f767" ,
168
- feature = "stm32f769" ,
169
- feature = "stm32f777" ,
170
- feature = "stm32f778" ,
171
- feature = "stm32f779" ,
172
- ) )
173
- ) ) ]
163
+ #[ cfg( feature = "device-selected" ) ]
174
164
pub mod flash;
175
165
176
166
pub mod state {
You can’t perform that action at this time.
0 commit comments