source: rtems/bsps/m68k/mcf5225x/btimer/btimer.c @ 753873e5

Last change on this file since 753873e5 was 753873e5, checked in by Joel Sherrill <joel@…>, on 03/22/22 at 20:03:30

Update Eric Norum contact info and start to normalize file headers

  • Property mode set to 100644
File size: 890 bytes
Line 
1/*
2 *  Timer Init
3 *
4 *  Use the last DMA timer (DTIM3) as the diagnostic timer.
5 */
6
7/*
8 * Copyright (c) 2005 Eric Norum <eric@norum.ca>
9 *
10 * COPYRIGHT (c) 2005-2010.
11 * On-Line Applications Research Corporation (OAR).
12 *
13 * The license and distribution terms for this file may be
14 * found in the file LICENSE in this distribution or at
15 * http://www.rtems.org/license/LICENSE.
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 */
34benchmark_timer_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.