source: rtems/c/src/lib/libbsp/arm/lpc176x/benchmark_timer/benchmark_timer.c @ 7b35a36

4.115
Last change on this file since 7b35a36 was 8fbe2e6, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/14 at 13:59:49

Use correct prototype of benchmark_timer_read()

This change starts with removing the effectively empty file
timerdrv.h. The prototypes for benchmark_timer_XXX() were in
btimer.h which was not universally used. Thus every use of
timerdrv.h had to be changed to btimer.h. Then the prototypes
for benchmark_timer_read() had to be adjusted to return
benchmark_timer_t rather than int or uint32_t.

I took this opportunity to also correct the file headers to
separate the copyright from the file description comments which
is needed to ensure the copyright isn't propagated into Doxygen
output.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/**
2 * @file timerbenchmark.c
3 *
4 * @ingroup lpc176x
5 *
6 * @brief Timer benchmark functions for the lpc176x bsp.
7 */
8
9/*
10 * Copyright (c) 2014 Taller Technologies.
11 *
12 * @author  Boretto Martin    (martin.boretto@tallertechnologies.com)
13 * @author  Diaz Marcos (marcos.diaz@tallertechnologies.com)
14 * @author  Lenarduzzi Federico  (federico.lenarduzzi@tallertechnologies.com)
15 * @author  Daniel Chicco  (daniel.chicco@tallertechnologies.com)
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.com/license/LICENSE.
20 */
21
22#include <rtems.h>
23#include <bsp.h>
24#include <rtems/btimer.h>
25
26#include <bsp/timer.h>
27
28static uint32_t benchmark_timer_base;
29
30void benchmark_timer_initialize( void )
31{
32  benchmark_timer_base = lpc176x_timer_get_timer_value( LPC176X_TIMER_1 );
33}
34
35benchmark_timer_t benchmark_timer_read( void )
36{
37  uint32_t delta = lpc176x_timer_get_timer_value( LPC176X_TIMER_1 ) -
38                   benchmark_timer_base;
39
40  return delta;
41}
42
43void benchmark_timer_disable_subtracting_average_overhead( bool find_avg_ovhead )
44{
45}
Note: See TracBrowser for help on using the repository browser.