@@ -441,14 +441,6 @@ void ticker_speed_test(void)
441
441
442
442
const ticker_info_t *us_ticker_info = get_us_ticker_data ()->interface ->get_info ();
443
443
444
- /* Free function will disable the ticker. For time measurement
445
- * we need to use other one if available.
446
- */
447
- #if DEVICE_LPTICKER
448
- const ticker_info_t *lp_ticker_info = get_lp_ticker_data ()->interface ->get_info ();
449
- bool us_ticker_test = (intf == get_us_ticker_data ()->interface );
450
- #endif
451
-
452
444
/* ---- Test ticker_read function. ---- */
453
445
start = us_ticker_read ();
454
446
while (counter--) {
@@ -498,71 +490,8 @@ void ticker_speed_test(void)
498
490
499
491
TEST_ASSERT (diff_us (start, stop, us_ticker_info) < (NUM_OF_CALLS * (MAX_FUNC_EXEC_TIME_US + DELTA_FUNC_EXEC_TIME_US)));
500
492
501
- /* ---- Test free function. ---- */
502
- #if DEVICE_LPTICKER
503
- counter = NUM_OF_CALLS;
504
- if (us_ticker_test) {
505
- lp_ticker_init ();
506
- }
507
- start = us_ticker_test ? lp_ticker_read () : us_ticker_read ();
508
- while (counter--) {
509
- intf->free ();
510
- }
511
- stop = us_ticker_test ? lp_ticker_read () : us_ticker_read ();
512
-
513
- TEST_ASSERT (diff_us (start, stop, us_ticker_info) < (NUM_OF_CALLS * (MAX_FUNC_EXEC_TIME_US + DELTA_FUNC_EXEC_TIME_US)));
514
- #endif
515
- }
516
-
517
- /* Test that ticker_free disables ticker interrupt. */
518
- void ticker_free_interrupt_test (void )
519
- {
520
- overflow_protect ();
521
-
522
- uint32_t cycles_500_ticks = 50 ;
523
- uint32_t reference_ticks_count = 0 ;
524
-
525
- while (reference_ticks_count < TICKER_500_TICKS) {
526
- cycles_500_ticks *= 2 ;
527
- const uint32_t start = intf->read ();
528
- wait_cycles (cycles_500_ticks);
529
- reference_ticks_count = intf->read () - start;
530
- }
531
-
532
- intFlag = 0 ;
533
-
534
- intf->set_interrupt (intf->read () + (TICKER_500_TICKS / 2 ));
535
- intf->free ();
536
- wait_cycles (cycles_500_ticks);
537
- intf->init ();
538
- TEST_ASSERT_EQUAL (0 , intFlag);
539
- }
540
-
541
- /* Test that ticker can be successfully re-initialized after free(). */
542
- void ticker_init_free_test (void )
543
- {
544
- intf->free ();
545
- intf->init ();
546
-
547
- overflow_protect ();
548
-
549
- intFlag = 0 ;
550
-
551
- const uint32_t tick_count = intf->read ();
552
-
553
- intf->set_interrupt (intf->read () + TICKER_INT_VAL);
554
-
555
- while (intf->read () < (tick_count + TICKER_INT_VAL - TICKER_DELTA)) {
556
- TEST_ASSERT_EQUAL_INT_MESSAGE (0 , intFlag, " Interrupt fired too early" );
557
- }
558
-
559
- while (intf->read () < (tick_count + TICKER_INT_VAL + TICKER_DELTA)) {
560
- }
561
-
562
- TEST_ASSERT_EQUAL (1 , intFlag);
563
493
}
564
494
565
-
566
495
utest::v1::status_t us_ticker_setup (const Case *const source, const size_t index_of_case)
567
496
{
568
497
intf = get_us_ticker_data ()->interface ;
@@ -637,8 +566,6 @@ Case cases[] = {
637
566
Case (" Microsecond ticker overflow test" , us_ticker_setup, ticker_overflow_test, us_ticker_teardown),
638
567
Case (" Microsecond ticker increment test" , us_ticker_setup, ticker_increment_test, us_ticker_teardown),
639
568
Case (" Microsecond ticker speed test" , us_ticker_setup, ticker_speed_test, us_ticker_teardown),
640
- Case (" Microsecond ticker free interrupt test" , us_ticker_setup, ticker_free_interrupt_test, us_ticker_teardown),
641
- Case (" Microsecond re-init after free test" , us_ticker_setup, ticker_init_free_test, us_ticker_teardown),
642
569
#if DEVICE_LPTICKER
643
570
Case (" lp ticker init is safe to call repeatedly" , lp_ticker_setup, ticker_init_test, lp_ticker_teardown),
644
571
Case (" lp ticker info test" , lp_ticker_setup, ticker_info_test, lp_ticker_teardown),
@@ -649,8 +576,6 @@ Case cases[] = {
649
576
Case (" lp ticker overflow test" , lp_ticker_setup, ticker_overflow_test, lp_ticker_teardown),
650
577
Case (" lp ticker increment test" , lp_ticker_setup, ticker_increment_test, lp_ticker_teardown),
651
578
Case (" lp ticker speed test" , lp_ticker_setup, ticker_speed_test, lp_ticker_teardown),
652
- Case (" lp ticker free interrupt test" , lp_ticker_setup, ticker_free_interrupt_test, lp_ticker_teardown),
653
- Case (" lp ticker re-init after free test" , lp_ticker_setup, ticker_init_free_test, lp_ticker_teardown),
654
579
#endif
655
580
};
656
581
0 commit comments