Skip to content

Commit

Permalink
Added logic to display freq in decimal
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 committed Nov 26, 2024
1 parent 6150963 commit c8e7ab5
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;
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) {
counter_freq = counter_freq/1000;
if (counter_freq > 1000) {
counter_freq = counter_freq/1000;
print_mhz = 1;
}
}

if (print_mhz)
val_print(ACS_PRINT_DEBUG, "\n Counter frequency is %ld MHz", counter_freq);
else
val_print(ACS_PRINT_DEBUG, "\n Counter frequency is %ld KHz", counter_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_DEBUG, "\n Counter frequency is %ld MHz", counter_freq);
else
val_print(ACS_PRINT_DEBUG, "\n Counter frequency is %ld KHz", counter_freq);

val_set_status(index, RESULT_FAIL(TEST_NUM, 1));

}
Expand Down

0 comments on commit c8e7ab5

Please sign in to comment.