source: rtems/c/src/lib/libbsp/m68k/mcf52235/timer/timer.c @ 8fbe2e6

4.11
Last change on this file since 8fbe2e6 was 8fbe2e6, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 4, 2014 at 1:59:49 PM

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: 883 bytes
Line 
1/*
2 *  Timer Init
3 *
4 *  Use the last DMA timer (DTIM3) as the diagnostic timer.
5 *
6 *  Author: W. Eric Norum <norume@aps.anl.gov>
7 *
8 *  COPYRIGHT (c) 2005.
9 *  On-Line Applications Research Corporation (OAR).
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.org/license/LICENSE.
14 */
15
16#include <rtems.h>
17#include <rtems/btimer.h>
18#include <bsp.h>
19
20void benchmark_timer_initialize(void)
21{
22  uint32_t preScaleDivisor = bsp_get_CPU_clock_speed() / 1000000;
23
24  MCF_DTIM3_DTMR = 0;
25  MCF_DTIM3_DTMR = MCF_DTIM_DTMR_PS(preScaleDivisor - 1) |
26    MCF_DTIM_DTMR_CLK_DIV1 | MCF_DTIM_DTMR_RST;
27}
28
29/*
30 * Return timer value in microsecond units
31 */
32benchmark_timer_t benchmark_timer_read(void)
33{
34  return MCF_DTIM3_DTCN;
35}
36
37void benchmark_timer_disable_subtracting_average_overhead(bool find_flag)
38{
39}
Note: See TracBrowser for help on using the repository browser.