@@ -157,7 +157,6 @@ async fn test_sender(esp_id: u32, senders: SharedSenders, tests: TestsRoot) -> R
157157 let unix_tx = UNIX_SENDER . get ( ) . expect ( "UNIX_SENDER not set!" ) ;
158158 let mut rx = spawn_new_sender ( & senders, esp_id) . await ?;
159159
160- send_test_packet ( & unix_tx, & mut rx, esp_id, TestPacketData :: Start ) . await ?;
161160 send_test_packet ( & unix_tx, & mut rx, esp_id, TestPacketData :: ResetState ) . await ?;
162161
163162 let mut prev_idx: Option < usize > = None ;
@@ -251,11 +250,21 @@ async fn run_step(
251250 }
252251 TestStep :: SolveTime ( time) => {
253252 * last_time = * time;
254- send_test_packet ( & unix_tx, rx, esp_id, TestPacketData :: SolveTime ( * time) ) . await ?;
253+ send_test_packet ( & unix_tx, rx, esp_id, TestPacketData :: StackmatTime ( * time) ) . await ?;
254+
255+ tokio:: time:: sleep ( Duration :: from_millis ( * time + 100 ) ) . await ;
255256 }
256257 TestStep :: SolveTimeRng => {
257258 * last_time = random_time;
258- send_test_packet ( & unix_tx, rx, esp_id, TestPacketData :: SolveTime ( random_time) ) . await ?;
259+ send_test_packet (
260+ & unix_tx,
261+ rx,
262+ esp_id,
263+ TestPacketData :: StackmatTime ( random_time) ,
264+ )
265+ . await ?;
266+
267+ tokio:: time:: sleep ( Duration :: from_millis ( random_time + 100 ) ) . await ;
259268 }
260269 TestStep :: Snapshot => {
261270 send_test_packet ( & unix_tx, rx, esp_id, TestPacketData :: Snapshot ) . await ?;
@@ -267,14 +276,14 @@ async fn run_step(
267276 send_test_packet ( & unix_tx, rx, esp_id, TestPacketData :: ScanCard ( * card_id) ) . await ?;
268277 }
269278 TestStep :: Button { ref name, time } => {
270- let pins = tests. buttons . get ( name) ;
271- if let Some ( pins ) = pins {
279+ let pin = tests. buttons . get ( name) ;
280+ if let Some ( & pin ) = pin {
272281 send_test_packet (
273282 & unix_tx,
274283 rx,
275284 esp_id,
276285 TestPacketData :: ButtonPress {
277- pins : pins . to_owned ( ) ,
286+ pin ,
278287 press_time : * time,
279288 } ,
280289 )
0 commit comments