@@ -365,6 +365,26 @@ static void config_baudrate(uint32_t rate)
365
365
}
366
366
}
367
367
368
+ static void report_progress (uint32_t start )
369
+ {
370
+ static const uint32_t inc = CONFIG_UART_ASYNC_DUAL_TEST_TIMEOUT / 20 ;
371
+ static uint32_t next ;
372
+ static uint32_t progress ;
373
+
374
+ if ((k_uptime_get_32 () - start < inc ) && progress ) {
375
+ /* Reset state. */
376
+ next = inc ;
377
+ progress = 0 ;
378
+ }
379
+
380
+ if (k_uptime_get_32 () > (start + next )) {
381
+ progress += 5 ;
382
+ TC_PRINT ("\r%d%%" , progress );
383
+ next += inc ;
384
+ }
385
+ }
386
+
387
+
368
388
/* Test is running following scenario. Transmitter is sending packets which
369
389
* has 1 byte header with length followed by the payload. Transmitter can send
370
390
* packets in two modes: bulk where data is send in chunks without gaps between
@@ -380,6 +400,7 @@ static void var_packet_hwfc(uint32_t baudrate, bool tx_packets, bool cont)
380
400
{
381
401
int err ;
382
402
uint32_t load = 0 ;
403
+ uint32_t start = k_uptime_get_32 ();
383
404
384
405
config_baudrate (baudrate );
385
406
@@ -420,8 +441,10 @@ static void var_packet_hwfc(uint32_t baudrate, bool tx_packets, bool cont)
420
441
while (tx_data .cont || rx_data .cont ) {
421
442
fill_tx (& tx_data );
422
443
k_msleep (1 );
444
+ report_progress (start );
423
445
try_tx (tx_dev , false);
424
446
}
447
+ TC_PRINT ("\n" );
425
448
426
449
if (IS_ENABLED (CONFIG_CPU_LOAD )) {
427
450
load = cpu_load_get (true);
@@ -653,6 +676,7 @@ static void hci_like_rx(void)
653
676
uint8_t len ;
654
677
bool cont ;
655
678
bool explicit_pm = IS_ENABLED (CONFIG_PM_RUNTIME_IN_TEST );
679
+ uint32_t start = k_uptime_get_32 ();
656
680
657
681
while (1 ) {
658
682
if (explicit_pm ) {
@@ -704,7 +728,9 @@ static void hci_like_rx(void)
704
728
PM_CHECK (rx_dev , tx_dev , false);
705
729
706
730
check_payload (rx_data .buf , len );
731
+ report_progress (start );
707
732
}
733
+ TC_PRINT ("\n" );
708
734
}
709
735
710
736
#define HCI_LIKE_TX_STACK_SIZE 2048
0 commit comments