Skip to content

Commit

Permalink
Added logic to display freq in decimal (ARM-software#404)
Browse files Browse the repository at this point in the history
- Added changes to counter frequency in MHz/KHz

Signed-off-by: Balaji Gontumukkala <[email protected]>
  • Loading branch information
gontumukkala-balaji authored Dec 2, 2024
1 parent 436ad21 commit de00640
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions test_pool/timer/operating_system/test_os_t001.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

}
Expand Down

0 comments on commit de00640

Please sign in to comment.