File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -421,7 +421,7 @@ mod app {
421421 . state_dc_power_enabled
422422 . lock ( |r| * r = DcPowerState :: Off ) ;
423423 // Stop any SPI stuff that's currently going on (the host is about to be powered off)
424- ctx. shared . spi . lock ( |s| s. stop ( ) ) ;
424+ ctx. shared . spi . lock ( |s| s. reset ( & mut rcc ) ) ;
425425 // Put the host into reset
426426 ctx. shared . pin_sys_reset . lock ( |pin| pin. set_low ( ) . unwrap ( ) ) ;
427427 // Shut off the 5V power
@@ -469,8 +469,11 @@ mod app {
469469 // Is the board powered on? Don't do a reset if it's powered off.
470470 if ctx. shared . state_dc_power_enabled . lock ( |r| * r) == DcPowerState :: On {
471471 defmt:: info!( "Reset!" ) ;
472- ctx . shared . pin_sys_reset . lock ( |pin| pin . set_low ( ) . unwrap ( ) ) ;
472+ // Step 1 - Stop any SPI stuff that's currently going on (the host is about to be reset)
473473 ctx. shared . spi . lock ( |s| s. reset ( & mut rcc) ) ;
474+ // Step 2 - Hold reset line (active) low
475+ ctx. shared . pin_sys_reset . lock ( |pin| pin. set_low ( ) . unwrap ( ) ) ;
476+ // Step 3 - Take it out of reset in a short while
474477 // Returns an error if it's already scheduled (but we don't care)
475478 let _ = exit_reset:: spawn_after ( RESET_DURATION_MS . millis ( ) ) ;
476479 }
You can’t perform that action at this time.
0 commit comments