File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ const ERASE_WRITE_TIMEOUT_PER_MB: Duration = Duration::from_secs(40);
1313const ERASE_CHIP_TIMEOUT : Duration = Duration :: from_secs ( 120 ) ;
1414const MEM_END_TIMEOUT : Duration = Duration :: from_millis ( 50 ) ;
1515const SYNC_TIMEOUT : Duration = Duration :: from_millis ( 100 ) ;
16+ const FLASH_DEFLATE_END_TIMEOUT : Duration = Duration :: from_secs ( 10 ) ;
1617
1718/// Types of commands that can be sent to a target device
1819#[ derive( Copy , Clone , Debug , Display ) ]
@@ -49,6 +50,7 @@ impl CommandType {
4950 CommandType :: MemEnd => MEM_END_TIMEOUT ,
5051 CommandType :: Sync => SYNC_TIMEOUT ,
5152 CommandType :: EraseFlash => ERASE_CHIP_TIMEOUT ,
53+ CommandType :: FlashDeflateEnd => FLASH_DEFLATE_END_TIMEOUT ,
5254 _ => DEFAULT_TIMEOUT ,
5355 }
5456 }
@@ -58,7 +60,7 @@ impl CommandType {
5860 fn calc_timeout ( timeout_per_mb : Duration , size : u32 ) -> Duration {
5961 let mb = size as f64 / 1_000_000.0 ;
6062 std:: cmp:: max (
61- DEFAULT_TIMEOUT ,
63+ FLASH_DEFLATE_END_TIMEOUT ,
6264 Duration :: from_millis ( ( timeout_per_mb. as_millis ( ) as f64 * mb) as u64 ) ,
6365 )
6466 }
You can’t perform that action at this time.
0 commit comments