Changeset 7222a65 in rtems


Ignore:
Timestamp:
06/21/16 07:45:39 (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
4c927c79
Parents:
fa239ff2
git-author:
Sebastian Huber <sebastian.huber@…> (06/21/16 07:45:39)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/21/16 13:54:18)
Message:

sptests/spcpucounter01: Resurrect workaround

Resurrect workaround accidentially removed by
3e2a3c49480b9888362d016dd202edd562d9e069.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/sptests/spcpucounter01/init.c

    rfa239ff2 r7222a65  
    159159}
    160160
     161static uint64_t large_delta_to_ns(rtems_counter_ticks d)
     162{
     163  uint64_t ns;
     164
     165  ns = rtems_counter_ticks_to_nanoseconds(d);
     166
     167  /* Special case for CPU counters using the clock driver counter */
     168  if (ns < rtems_configuration_get_nanoseconds_per_tick()) {
     169    printf(
     170      "warning: the RTEMS counter seems to be unable to\n"
     171      "  measure intervals greater than the clock tick interval\n"
     172    );
     173
     174    ns += rtems_configuration_get_nanoseconds_per_tick();
     175  }
     176
     177  return ns;
     178}
     179
    161180static void test_report(test_context *ctx)
    162181{
     
    170189  for (i = 0; i < N; ++i) {
    171190    d = rtems_counter_difference(ctx->delay_ns_t[i][1], ctx->delay_ns_t[i][0]);
    172     ns = rtems_counter_ticks_to_nanoseconds(d);
     191    ns = large_delta_to_ns(d);
    173192
    174193    printf(
     
    187206      ctx->delay_ticks_t[i][0]
    188207    );
    189     ns = rtems_counter_ticks_to_nanoseconds(d);
     208    ns = large_delta_to_ns(d);
    190209
    191210    printf(
Note: See TracChangeset for help on using the changeset viewer.