source: rtems/c/src/lib/libbsp/m68k/mcf5225x/timer/timer.c @ 26c17377

4.115
Last change on this file since 26c17377 was 26c17377, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/09/11 at 12:15:54

2011-02-09 Ralf Corsépius <ralf.corsepius@…>

  • timer/timer.c: Include <rtems/btimer.h>. Fix benchmark_timer_read() definition.
  • Property mode set to 100644
File size: 891 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-2010.
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.com/license/LICENSE.
14 *
15 *  $Id$
16 */
17
18#include <rtems.h>
19#include <rtems/btimer.h>
20#include <bsp.h>
21
22void benchmark_timer_initialize(void)
23{
24  uint32_t preScaleDivisor = bsp_get_CPU_clock_speed() / 1000000;
25
26  MCF_DTIM3_DTMR = 0;
27  MCF_DTIM3_DTMR = MCF_DTIM_DTMR_PS(preScaleDivisor - 1) |
28    MCF_DTIM_DTMR_CLK_DIV1 | MCF_DTIM_DTMR_RST;
29}
30
31/*
32 * Return timer value in microsecond units
33 */
34uint32_t benchmark_timer_read(void)
35{
36  return MCF_DTIM3_DTCN;
37}
38
39void benchmark_timer_disable_subtracting_average_overhead(bool find_flag)
40{
41}
Note: See TracBrowser for help on using the repository browser.