diff --git a/test_pool/timer/operating_system/test_os_t001.c b/test_pool/timer/operating_system/test_os_t001.c index cf98f08d..5762b5e4 100644 --- a/test_pool/timer/operating_system/test_os_t001.c +++ b/test_pool/timer/operating_system/test_os_t001.c @@ -27,18 +27,35 @@ void payload() { - uint32_t counter_freq; + uint64_t counter_freq, print_freq; uint32_t index = val_pe_get_index_mpid(val_pe_get_mpid()); + uint32_t print_mhz = 0; counter_freq = val_timer_get_info(TIMER_INFO_CNTFREQ, 0); - val_print(ACS_PRINT_DEBUG, "\n Counter frequency is %x ", counter_freq); + + if (counter_freq != 0) { + print_freq = counter_freq/1000; + if (print_freq > 1000) { + print_freq = print_freq/1000; + print_mhz = 1; + } + } + + if (print_mhz) + val_print(ACS_PRINT_DEBUG, "\n Counter frequency is %ld MHz", print_freq); + else + val_print(ACS_PRINT_DEBUG, "\n Counter frequency is %ld KHz", print_freq); if (counter_freq > 10*1000*1000) { val_set_status(index, RESULT_PASS(TEST_NUM, 1)); return; } - val_print(ACS_PRINT_ERR, "\n Counter frequency is %x ", counter_freq); + if (print_mhz) + val_print(ACS_PRINT_ERR, "\n Counter frequency is %ld MHz", print_freq); + else + val_print(ACS_PRINT_ERR, "\n Counter frequency is %ld KHz", print_freq); + val_set_status(index, RESULT_FAIL(TEST_NUM, 1)); }