source: rtems/bsps/arm/lpc24xx/start/timer.c @ c991eeec

5
Last change on this file since c991eeec was c991eeec, checked in by Sebastian Huber <sebastian.huber@…>, on 03/04/19 at 14:32:15

bsps: Adjust bsp.h Doxygen groups

Update #3706.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup RTEMSBSPsARMLPC24XX
5 *
6 * @brief Benchmark timer support.
7 */
8
9/*
10 * Copyright (c) 2008, 2009
11 * embedded brains GmbH
12 * Obere Lagerstr. 30
13 * D-82178 Puchheim
14 * Germany
15 * <rtems@embedded-brains.de>
16 *
17 * The license and distribution terms for this file may be
18 * found in the file LICENSE in this distribution or at
19 * http://www.rtems.org/license/LICENSE.
20 */
21
22#include <rtems.h>
23#include <bsp.h>
24#include <rtems/btimer.h>
25
26#include <bsp/system-clocks.h>
27
28bool benchmark_timer_find_average_overhead = false;
29
30static uint32_t benchmark_timer_base;
31
32void benchmark_timer_initialize(void)
33{
34  benchmark_timer_base = lpc24xx_timer();
35}
36
37benchmark_timer_t benchmark_timer_read(void)
38{
39  uint32_t delta = lpc24xx_timer() - benchmark_timer_base;
40
41  if (benchmark_timer_find_average_overhead) {
42    return delta;
43  } else {
44    /* Value determined by tmck for NCS board */
45    if (delta > 74) {
46      return delta - 74;
47    } else {
48      return 0;
49    }
50  }
51}
52
53void benchmark_timer_disable_subtracting_average_overhead(bool find_average_overhead )
54{
55  benchmark_timer_find_average_overhead = find_average_overhead;
56}
Note: See TracBrowser for help on using the repository browser.