diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2005-06-17 14:06:05 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2005-06-17 14:06:05 +0000 |
commit | 1612af0f62aff5f0f077af77c44203cfa2f7603e (patch) | |
tree | ef72b7295687729ced88425a7736ce0ac814b9fb /c/src/lib/libbsp/m68k/mcf5235/timer/timer.c | |
parent | 2005-06-17 Joel Sherrill <joel@OARcorp.com> (diff) | |
download | rtems-1612af0f62aff5f0f077af77c44203cfa2f7603e.tar.bz2 |
2005-06-17 Mike Bertosh <mbertosh@motioncontrol.org>
* .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.
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/m68k/mcf5235/timer/timer.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/m68k/mcf5235/timer/timer.c b/c/src/lib/libbsp/m68k/mcf5235/timer/timer.c new file mode 100644 index 0000000000..f266afa712 --- /dev/null +++ b/c/src/lib/libbsp/m68k/mcf5235/timer/timer.c @@ -0,0 +1,43 @@ +/* + * Timer Init + * + * Use the last DMA timer (DTIM3) as the diagnostic timer. + */ + +#include <rtems.h> +#include <bsp.h> + +void +Timer_initialize(void) +{ + int preScaleDivisor = 0x4A; + int div = MCF5235_TIMER_DTMR_CLK_DIV1; + MCF5235_TIMER_DTRR3 = 0x2710; + MCF5235_TIMER3_DTMR = 0; + MCF5235_TIMER3_DTMR = MCF5235_TIMER_DTMR_PS(preScaleDivisor) | div | + MCF5235_TIMER_DTMR_RST; +} + +/* + * Return timer value in microsecond units + */ +int +Read_timer(void) +{ + return MCF5235_TIMER3_DTCN; +} + +/* + * Empty function call used in loops to measure basic cost of looping + * in Timing Test Suite. + */ +rtems_status_code +Empty_function(void) +{ + return RTEMS_SUCCESSFUL; +} + +void +Set_find_average_overhead(rtems_boolean find_flag) +{ +} |