Last change
on this file since c9625a21 was
e0dd8a5a,
checked in by Sebastian Huber <sebastian.huber@…>, on 04/20/18 at 10:08:42
|
bsps: Move benchmark timer to bsps
This patch is a part of the BSP source reorganization.
Update #3285.
|
-
Property mode set to
100644
|
File size:
888 bytes
|
Line | |
---|
1 | /* |
---|
2 | * Timer Init |
---|
3 | * |
---|
4 | * Use the last DMA timer (DTIM3) as the diagnostic timer. |
---|
5 | * |
---|
6 | * Author: W. Eric Norum <norume@aps.anl.gov> |
---|
7 | * |
---|
8 | * COPYRIGHT (c) 2005-2010. |
---|
9 | * On-Line Applications Research Corporation (OAR). |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in the file LICENSE in this distribution or at |
---|
13 | * http://www.rtems.org/license/LICENSE. |
---|
14 | */ |
---|
15 | |
---|
16 | #include <rtems.h> |
---|
17 | #include <rtems/btimer.h> |
---|
18 | #include <bsp.h> |
---|
19 | |
---|
20 | void benchmark_timer_initialize(void) |
---|
21 | { |
---|
22 | uint32_t preScaleDivisor = bsp_get_CPU_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 | */ |
---|
32 | benchmark_timer_t benchmark_timer_read(void) |
---|
33 | { |
---|
34 | return MCF_DTIM3_DTCN; |
---|
35 | } |
---|
36 | |
---|
37 | void benchmark_timer_disable_subtracting_average_overhead(bool find_flag) |
---|
38 | { |
---|
39 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.