summaryrefslogtreecommitdiffstats
path: root/bsps/arm/lpc176x/btimer/btimer.c
blob: 359d89086d0ebb87c27f3060648f6d3a8897e835 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
 * @file timerbenchmark.c
 *
 * @ingroup lpc176x
 *
 * @brief Timer benchmark functions for the lpc176x bsp.
 */

/*
 * Copyright (c) 2014 Taller Technologies.
 *
 * @author  Boretto Martin    (martin.boretto@tallertechnologies.com)
 * @author  Diaz Marcos (marcos.diaz@tallertechnologies.com)
 * @author  Lenarduzzi Federico  (federico.lenarduzzi@tallertechnologies.com)
 * @author  Daniel Chicco  (daniel.chicco@tallertechnologies.com)
 *
 * The license and distribution terms for this file may be
 * found in the file LICENSE in this distribution or at
 * http://www.rtems.org/license/LICENSE.
 */

#include <rtems.h>
#include <bsp.h>
#include <rtems/btimer.h>

#include <bsp/timer.h>

static uint32_t benchmark_timer_base;

void benchmark_timer_initialize( void )
{
  benchmark_timer_base = lpc176x_timer_get_timer_value( LPC176X_TIMER_1 );
}

benchmark_timer_t benchmark_timer_read( void )
{
  uint32_t delta = lpc176x_timer_get_timer_value( LPC176X_TIMER_1 ) -
                   benchmark_timer_base;

  return delta;
}

void benchmark_timer_disable_subtracting_average_overhead( bool find_avg_ovhead )
{
}