source: rtems/c/src/lib/libbsp/m68k/mcf5329/timer/timer.c @ 6b56ec3

4.104.114.95
Last change on this file since 6b56ec3 was 6b56ec3, checked in by Joel Sherrill <joel.sherrill@…>, on Jun 20, 2008 at 2:58:34 PM

2008-06-20 Matthew Riek <matthew.riek@…>

  • ChangeLog?, Makefile.am, README, bsp_specs, configure.ac, gdb-init, preinstall.am, clock/clock.c, console/console.c, include/bsp.h, include/bspopts.h.in, include/coverhd.h, include/tm27.h, network/network.c, start/start.S, startup/bspclean.c, startup/bspstart.c, startup/cfinit.c, startup/init5329.c, startup/linkcmds, startup/linkcmdsflash, timer/timer.c: New files.
  • Property mode set to 100644
File size: 981 bytes
Line 
1
2/*
3 *  Timer Init
4 *
5 *  Use the last DMA timer (DTIM3) as the diagnostic timer.
6 *
7 *  Author: W. Eric Norum <norume@aps.anl.gov>
8 *
9 *  COPYRIGHT (c) 2005.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.com/license/LICENSE.
15 */
16
17#include <rtems.h>
18#include <bsp.h>
19
20void Timer_initialize(void)
21{
22  uint32_t preScaleDivisor = bsp_get_BUS_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 */
32int Read_timer(void)
33{
34  return MCF_DTIM3_DTCN;
35}
36
37/*
38 *  Empty function call used in loops to measure basic cost of looping
39 *  in Timing Test Suite.
40 */
41rtems_status_code Empty_function(void)
42{
43  return RTEMS_SUCCESSFUL;
44}
45
46void Set_find_average_overhead(rtems_boolean find_flag)
47{
48}
Note: See TracBrowser for help on using the repository browser.