Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:47

0001 /*
0002  *  Timer Init
0003  *
0004  *  Use the last DMA timer (DTIM3) as the diagnostic timer.
0005  */
0006 
0007 /*
0008  * Copyright (c) 2005 Eric Norum <eric@norum.ca>
0009  *
0010  * COPYRIGHT (c) 2005-2010.
0011  * On-Line Applications Research Corporation (OAR).
0012  *
0013  * The license and distribution terms for this file may be
0014  * found in the file LICENSE in this distribution or at
0015  * http://www.rtems.org/license/LICENSE.
0016  */
0017 
0018 #include <rtems.h>
0019 #include <rtems/btimer.h>
0020 #include <bsp.h>
0021 
0022 void benchmark_timer_initialize(void)
0023 {
0024   uint32_t preScaleDivisor = bsp_get_CPU_clock_speed() / 1000000;
0025 
0026   MCF_DTIM3_DTMR = 0;
0027   MCF_DTIM3_DTMR = MCF_DTIM_DTMR_PS(preScaleDivisor - 1) |
0028     MCF_DTIM_DTMR_CLK_DIV1 | MCF_DTIM_DTMR_RST;
0029 }
0030 
0031 /*
0032  * Return timer value in microsecond units
0033  */
0034 benchmark_timer_t benchmark_timer_read(void)
0035 {
0036   return MCF_DTIM3_DTCN;
0037 }
0038 
0039 void benchmark_timer_disable_subtracting_average_overhead(bool find_flag)
0040 {
0041 }