@@ -1824,6 +1824,8 @@ impl PddbOs {
1824
1824
t ! ( "pddb.erase" , xous:: LANG ) ,
1825
1825
xous:: PDDB_LOC , xous:: PDDB_LOC + PDDB_A_LEN as u32 , xous:: PDDB_LOC )
1826
1826
. expect ( "couldn't raise progress bar" ) ;
1827
+ // retain this delay, because the next section is so compute-intensive, it may take a
1828
+ // while for the GAM to catch up.
1827
1829
self . tt . sleep_ms ( 100 ) . unwrap ( ) ;
1828
1830
}
1829
1831
for offset in ( xous:: PDDB_LOC ..( xous:: PDDB_LOC + PDDB_A_LEN as u32 ) ) . step_by ( SPINOR_BULK_ERASE_SIZE as usize ) {
@@ -1849,6 +1851,7 @@ impl PddbOs {
1849
1851
if let Some ( modals) = progress {
1850
1852
modals. update_progress ( xous:: PDDB_LOC + PDDB_A_LEN as u32 ) . expect ( "couldn't update progress bar" ) ;
1851
1853
modals. finish_progress ( ) . expect ( "couldn't dismiss progress bar" ) ;
1854
+ #[ cfg( feature="ux-swap-delay" ) ]
1852
1855
self . tt . sleep_ms ( 100 ) . unwrap ( ) ;
1853
1856
}
1854
1857
}
@@ -1881,6 +1884,7 @@ impl PddbOs {
1881
1884
}
1882
1885
if let Some ( modals) = progress {
1883
1886
modals. finish_progress ( ) . expect ( "couldn't dismiss progress bar" ) ;
1887
+ #[ cfg( feature="ux-swap-delay" ) ]
1884
1888
self . tt . sleep_ms ( 100 ) . unwrap ( ) ;
1885
1889
}
1886
1890
@@ -1891,6 +1895,7 @@ impl PddbOs {
1891
1895
//}
1892
1896
if let Some ( modals) = progress {
1893
1897
modals. start_progress ( t ! ( "pddb.key" , xous:: LANG ) , 0 , 100 , 0 ) . expect ( "couldn't raise progress bar" ) ;
1898
+ #[ cfg( feature="ux-swap-delay" ) ]
1894
1899
self . tt . sleep_ms ( 100 ) . unwrap ( ) ;
1895
1900
}
1896
1901
assert ! ( size_of:: <StaticCryptoData >( ) == PAGE_SIZE , "StaticCryptoData structure is not correctly sized" ) ;
@@ -1914,6 +1919,7 @@ impl PddbOs {
1914
1919
crypto_keys. version = SCD_VERSION ; // should already be set by `default()` but let's be sure.
1915
1920
if let Some ( modals) = progress {
1916
1921
modals. update_progress ( 50 ) . expect ( "couldn't update progress bar" ) ;
1922
+ #[ cfg( feature="ux-swap-delay" ) ]
1917
1923
self . tt . sleep_ms ( 100 ) . unwrap ( ) ;
1918
1924
}
1919
1925
// copy the encrypted key into the data structure for commit to Flash
@@ -1932,8 +1938,10 @@ impl PddbOs {
1932
1938
self . patch_keys ( crypto_keys. deref ( ) , 0 ) ;
1933
1939
if let Some ( modals) = progress {
1934
1940
modals. update_progress ( 100 ) . expect ( "couldn't update progress bar" ) ;
1941
+ #[ cfg( feature="ux-swap-delay" ) ]
1935
1942
self . tt . sleep_ms ( 100 ) . unwrap ( ) ;
1936
1943
modals. finish_progress ( ) . expect ( "couldn't dismiss progress bar" ) ;
1944
+ #[ cfg( feature="ux-swap-delay" ) ]
1937
1945
self . tt . sleep_ms ( 100 ) . unwrap ( ) ;
1938
1946
}
1939
1947
// now we have a copy of the AES key necessary to encrypt the default System basis that we created in step 2.
@@ -1960,13 +1968,16 @@ impl PddbOs {
1960
1968
}
1961
1969
if let Some ( modals) = progress {
1962
1970
modals. update_progress ( 50 ) . expect ( "couldn't update progress bar" ) ;
1971
+ #[ cfg( feature="ux-swap-delay" ) ]
1963
1972
self . tt . sleep_ms ( 100 ) . unwrap ( ) ;
1964
1973
}
1965
1974
self . fast_space_write ( & fast_space) ;
1966
1975
if let Some ( modals) = progress {
1967
1976
modals. update_progress ( 100 ) . expect ( "couldn't update progress bar" ) ;
1977
+ #[ cfg( feature="ux-swap-delay" ) ]
1968
1978
self . tt . sleep_ms ( 100 ) . unwrap ( ) ;
1969
1979
modals. finish_progress ( ) . expect ( "couldn't dismiss progress bar" ) ;
1980
+ #[ cfg( feature="ux-swap-delay" ) ]
1970
1981
self . tt . sleep_ms ( 100 ) . unwrap ( ) ;
1971
1982
}
1972
1983
@@ -1979,6 +1990,7 @@ impl PddbOs {
1979
1990
if let Some ( modals) = progress {
1980
1991
modals. start_progress ( t ! ( "pddb.randomize" , xous:: LANG ) ,
1981
1992
self . data_phys_base . as_u32 ( ) , PDDB_A_LEN as u32 , self . data_phys_base . as_u32 ( ) ) . expect ( "couldn't raise progress bar" ) ;
1993
+ #[ cfg( feature="ux-swap-delay" ) ]
1982
1994
self . tt . sleep_ms ( 100 ) . unwrap ( ) ;
1983
1995
}
1984
1996
let blank = [ 0xffu8 ; aes:: BLOCK_SIZE ] ;
@@ -2018,14 +2030,17 @@ impl PddbOs {
2018
2030
}
2019
2031
if let Some ( modals) = progress {
2020
2032
modals. update_progress ( PDDB_A_LEN as u32 ) . expect ( "couldn't update progress bar" ) ;
2033
+ #[ cfg( feature="ux-swap-delay" ) ]
2021
2034
self . tt . sleep_ms ( 100 ) . unwrap ( ) ;
2022
2035
modals. finish_progress ( ) . expect ( "couldn't dismiss progress bar" ) ;
2036
+ #[ cfg( feature="ux-swap-delay" ) ]
2023
2037
self . tt . sleep_ms ( 100 ) . unwrap ( ) ;
2024
2038
}
2025
2039
2026
2040
// step 6. create the system basis root structure
2027
2041
if let Some ( modals) = progress {
2028
2042
modals. start_progress ( t ! ( "pddb.structure" , xous:: LANG ) , 0 , 100 , 0 ) . expect ( "couldn't raise progress bar" ) ;
2043
+ #[ cfg( feature="ux-swap-delay" ) ]
2029
2044
self . tt . sleep_ms ( 100 ) . unwrap ( ) ;
2030
2045
}
2031
2046
let basis_root = BasisRoot {
@@ -2040,6 +2055,7 @@ impl PddbOs {
2040
2055
self . fast_space_read ( ) ; // we reconstitute our fspace map even though it was just generated, partially as a sanity check that everything is ok
2041
2056
if let Some ( modals) = progress {
2042
2057
modals. update_progress ( 33 ) . expect ( "couldn't update progress bar" ) ;
2058
+ #[ cfg( feature="ux-swap-delay" ) ]
2043
2059
self . tt . sleep_ms ( 100 ) . unwrap ( ) ;
2044
2060
}
2045
2061
@@ -2075,6 +2091,7 @@ impl PddbOs {
2075
2091
self . system_basis_key = Some ( syskey) ; // put the key back
2076
2092
if let Some ( modals) = progress {
2077
2093
modals. update_progress ( 66 ) . expect ( "couldn't update progress bar" ) ;
2094
+ #[ cfg( feature="ux-swap-delay" ) ]
2078
2095
self . tt . sleep_ms ( 100 ) . unwrap ( ) ;
2079
2096
}
2080
2097
@@ -2086,8 +2103,10 @@ impl PddbOs {
2086
2103
}
2087
2104
if let Some ( modals) = progress {
2088
2105
modals. update_progress ( 100 ) . expect ( "couldn't update progress bar" ) ;
2106
+ #[ cfg( feature="ux-swap-delay" ) ]
2089
2107
self . tt . sleep_ms ( 100 ) . unwrap ( ) ;
2090
2108
modals. finish_progress ( ) . expect ( "couldn't dismiss progress bar" ) ;
2109
+ #[ cfg( feature="ux-swap-delay" ) ]
2091
2110
self . tt . sleep_ms ( 100 ) . unwrap ( ) ;
2092
2111
}
2093
2112
Ok ( ( ) )
@@ -2384,6 +2403,7 @@ impl PddbOs {
2384
2403
/// at the conclusion of the sweep, but their page use can be accounted for.
2385
2404
#[ cfg( not( all( feature="pddbtest" , feature="autobasis" ) ) ) ]
2386
2405
pub ( crate ) fn pddb_get_all_keys ( & self , cache : & Vec :: < BasisCacheEntry > ) -> Option < Vec < ( BasisKeys , String ) > > {
2406
+ #[ cfg( feature="ux-swap-delay" ) ]
2387
2407
const SWAP_DELAY_MS : usize = 300 ;
2388
2408
// populate the "known" entries
2389
2409
let mut ret = Vec :: < ( BasisKeys , String ) > :: new ( ) ;
@@ -2420,6 +2440,7 @@ impl PddbOs {
2420
2440
DnaMode :: Churn => t ! ( "pddb.churn.request" , xous:: LANG ) ,
2421
2441
} ,
2422
2442
None ) . ok ( ) ;
2443
+ #[ cfg( feature="ux-swap-delay" ) ]
2423
2444
self . tt . sleep_ms ( SWAP_DELAY_MS ) . unwrap ( ) ;
2424
2445
2425
2446
// 0.5 display the Bases that we know
@@ -2429,10 +2450,12 @@ impl PddbOs {
2429
2450
blist. push_str ( name) ;
2430
2451
}
2431
2452
modals. show_notification ( & blist, None ) . ok ( ) ;
2453
+ #[ cfg( feature="ux-swap-delay" ) ]
2432
2454
self . tt . sleep_ms ( SWAP_DELAY_MS ) . unwrap ( ) ;
2433
2455
2434
2456
// 1. prompt user to enter any name/password combos for other basis we want to keep
2435
2457
while self . yes_no_approval ( & modals, t ! ( "pddb.freespace.enumerate_another" , xous:: LANG ) ) {
2458
+ #[ cfg( feature="ux-swap-delay" ) ]
2436
2459
self . tt . sleep_ms ( SWAP_DELAY_MS ) . unwrap ( ) ;
2437
2460
2438
2461
match modals
@@ -2478,11 +2501,13 @@ impl PddbOs {
2478
2501
ret. push ( ( basis_key, name) ) ;
2479
2502
} else {
2480
2503
modals. show_notification ( t ! ( "pddb.freespace.badpass" , xous:: LANG ) , None ) . ok ( ) ;
2504
+ #[ cfg( feature="ux-swap-delay" ) ]
2481
2505
self . tt . sleep_ms ( SWAP_DELAY_MS ) . unwrap ( ) ;
2482
2506
}
2483
2507
} ,
2484
2508
_ => return None ,
2485
2509
} ;
2510
+ #[ cfg( feature="ux-swap-delay" ) ]
2486
2511
self . tt . sleep_ms ( SWAP_DELAY_MS ) . unwrap ( ) ;
2487
2512
// 4. repeat summary print-out
2488
2513
let mut blist = String :: from ( t ! ( "pddb.freespace.currentlist" , xous:: LANG ) ) ;
@@ -2491,6 +2516,7 @@ impl PddbOs {
2491
2516
blist. push_str ( name) ;
2492
2517
}
2493
2518
modals. show_notification ( & blist, None ) . ok ( ) ;
2519
+ #[ cfg( feature="ux-swap-delay" ) ]
2494
2520
self . tt . sleep_ms ( SWAP_DELAY_MS ) . unwrap ( ) ;
2495
2521
}
2496
2522
// done!
0 commit comments