File tree 2 files changed +5
-10
lines changed
2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ impl Connection {
145
145
}
146
146
147
147
/// Initialize a connection with a device
148
- pub fn begin ( & mut self ) -> Result < bool , Error > {
148
+ pub fn begin ( & mut self ) -> Result < ( ) , Error > {
149
149
let port_name = self . serial . name ( ) . unwrap_or_default ( ) ;
150
150
let reset_sequence = construct_reset_strategy_sequence (
151
151
& port_name,
@@ -156,14 +156,7 @@ impl Connection {
156
156
for ( _, reset_strategy) in zip ( 0 ..MAX_CONNECT_ATTEMPTS , reset_sequence. iter ( ) . cycle ( ) ) {
157
157
match self . connect_attempt ( reset_strategy) {
158
158
Ok ( _) => {
159
- match self . read_reg ( crate :: flasher:: stubs:: CHIP_DETECT_MAGIC_REG_ADDR ) {
160
- Ok ( _) => return Ok ( false ) ,
161
- Err ( _) => {
162
- log:: warn!( "Secure Download Mode is enabled on this chip" ) ;
163
- self . secure_download_mode = true ;
164
- return Ok ( true ) ;
165
- }
166
- } ;
159
+ return Ok ( ( ) ) ;
167
160
}
168
161
Err ( e) => {
169
162
debug ! ( "Failed to reset, error {:#?}, retrying" , e) ;
Original file line number Diff line number Diff line change @@ -674,7 +674,7 @@ impl Flasher {
674
674
// Establish a connection to the device using the default baud rate of 115,200
675
675
// and timeout of 3 seconds.
676
676
let mut connection = Connection :: new ( serial, port_info, after_operation, before_operation) ;
677
- let sdm = connection. begin ( ) ?;
677
+ connection. begin ( ) ?;
678
678
connection. set_timeout ( DEFAULT_TIMEOUT ) ?;
679
679
680
680
let detected_chip = if before_operation != ResetBeforeOperation :: NoResetNoSync {
@@ -696,6 +696,8 @@ impl Flasher {
696
696
return Err ( Error :: ChipNotProvided ) ;
697
697
} ;
698
698
699
+ let sdm = connection. secure_download_mode ;
700
+
699
701
let mut flasher = Flasher {
700
702
connection,
701
703
chip : detected_chip,
You can’t perform that action at this time.
0 commit comments