source: rtems/c/src/lib/libbsp/m68k/mcf5235/timer/timer.c @ df8ba46

4.104.114.84.95
Last change on this file since df8ba46 was 1612af0, checked in by Joel Sherrill <joel.sherrill@…>, on 06/17/05 at 14:06:05

2005-06-17 Mike Bertosh <mbertosh@…>

  • .cvsignore, ChangeLog?, Makefile.am, README, bsp_specs, configure.ac, clock/clock.c, console/console.c, include/bsp.h, include/coverhd.h, include/tm27.h, network/network.c, start/start.S, startup/bspclean.c, startup/bspstart.c, startup/init5235.c, startup/linkcmds, startup/linkcmdsflash, startup/linkcmdsram, timer/timer.c: New files.
  • Property mode set to 100644
File size: 762 bytes
RevLine 
[1612af0]1/*
2 *  Timer Init
3 *
4 *  Use the last DMA timer (DTIM3) as the diagnostic timer.
5 */
6
7#include <rtems.h>
8#include <bsp.h>
9
10void
11Timer_initialize(void)
12{
13    int preScaleDivisor = 0x4A;
14    int div = MCF5235_TIMER_DTMR_CLK_DIV1;
15    MCF5235_TIMER_DTRR3 = 0x2710;
16    MCF5235_TIMER3_DTMR = 0;
17    MCF5235_TIMER3_DTMR = MCF5235_TIMER_DTMR_PS(preScaleDivisor) | div |
18                          MCF5235_TIMER_DTMR_RST;
19}
20
21/*
22 * Return timer value in microsecond units
23 */
24int
25Read_timer(void)
26{
27    return MCF5235_TIMER3_DTCN;
28}
29
30/*
31 *  Empty function call used in loops to measure basic cost of looping
32 *  in Timing Test Suite.
33 */
34rtems_status_code
35Empty_function(void)
36{
37    return RTEMS_SUCCESSFUL;
38}
39
40void
41Set_find_average_overhead(rtems_boolean find_flag)
42{
43}
Note: See TracBrowser for help on using the repository browser.