@@ -141,11 +141,13 @@ fn main() -> Result<()> {
141
141
None
142
142
} ;
143
143
144
- // Connect the Flasher to the target device. If the '--board-info' flag has been
145
- // provided, display the board info and terminate the application.
144
+ // Connect the Flasher to the target device and print the board information
145
+ // upon connection. If the '--board-info' flag has been provided, we have
146
+ // nothing left to do so exit early.
146
147
let mut flasher = Flasher :: connect ( serial, speed) ?;
148
+ flasher. board_info ( ) ?;
149
+
147
150
if matches. is_present ( "board_info" ) {
148
- board_info ( & mut flasher) ?;
149
151
return Ok ( ( ) ) ;
150
152
}
151
153
@@ -193,6 +195,7 @@ fn main() -> Result<()> {
193
195
} else {
194
196
flasher. load_elf_to_flash ( & elf_data, bootloader, partition_table) ?;
195
197
}
198
+ println ! ( "\n Flashing has completed!" ) ;
196
199
197
200
if matches. is_present ( "monitor" ) {
198
201
monitor ( flasher. into_serial ( ) ) . into_diagnostic ( ) ?;
@@ -202,25 +205,6 @@ fn main() -> Result<()> {
202
205
Ok ( ( ) )
203
206
}
204
207
205
- fn board_info ( flasher : & mut Flasher ) -> Result < ( ) > {
206
- let chip = flasher. chip ( ) ;
207
- let revision = chip. chip_revision ( flasher. connection ( ) ) ?;
208
- let freq = chip. crystal_freq ( flasher. connection ( ) ) ?;
209
-
210
- // Print the detected chip type, and if available the silicon revision.
211
- print ! ( "Chip type: {}" , chip) ;
212
- if let Some ( revision) = revision {
213
- println ! ( " (revision {})" , revision) ;
214
- } else {
215
- println ! ( ) ;
216
- }
217
-
218
- println ! ( "Crystal frequency: {}MHz" , freq) ;
219
- println ! ( "Flash size: {}" , flasher. flash_size( ) ) ;
220
-
221
- Ok ( ( ) )
222
- }
223
-
224
208
fn build (
225
209
release : bool ,
226
210
example : Option < & str > ,
0 commit comments