This repository was archived by the owner on Dec 3, 2020. It is now read-only.
File tree 2 files changed +20
-1
lines changed
2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ config Get all configs
54
54
55
55
reboot Reboot the device
56
56
57
+ dfu Reboot into dfu mode
58
+
57
59
OPTIONS:
58
60
--flavor <flavor> [possible values: inav, baseflight, betafligth]
59
61
-p, --port <port> device serial port
Original file line number Diff line number Diff line change @@ -225,6 +225,10 @@ async fn main() {
225
225
App :: new ( "reboot" )
226
226
. about ( "Reboot the device" )
227
227
)
228
+ . subcommand (
229
+ App :: new ( "dfu" )
230
+ . about ( "Reboot into dfu mode" )
231
+ )
228
232
. arg (
229
233
Arg :: with_name ( "port" )
230
234
. short ( 'p' )
@@ -307,7 +311,20 @@ async fn main() {
307
311
. clone ( )
308
312
} ;
309
313
310
- // TODO: what stop and start bits are inav using, is every one just using the canonical defalts?
314
+ match matches. subcommand ( ) {
315
+ ( "dfu" , _) => {
316
+ let msg = "R\n " ;
317
+ let mut s = open_with_settings ( & port, & s)
318
+ . expect ( "Failed to open serial port" ) ;
319
+
320
+ s. write_all ( msg. as_bytes ( ) )
321
+ . expect ( "Unable to write bytes." ) ;
322
+ return ;
323
+ } ,
324
+ _ => ( )
325
+ }
326
+
327
+
311
328
let serialport = open_with_settings ( & port, & s)
312
329
. expect ( "Failed to open serial port" ) ;
313
330
You can’t perform that action at this time.
0 commit comments