diff options
author | Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> | 2009-12-15 15:20:47 +0000 |
---|---|---|
committer | Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> | 2009-12-15 15:20:47 +0000 |
commit | c468f18bb73a570bf2b3eb279a7dea60b91c3319 (patch) | |
tree | b181297c2b4a0f8fa3edbb9987fd99a3ecc45a8b /c/src/lib/libbsp/arm/lpc32xx/misc | |
parent | add support for ARM11, reimplement nested interrupts (diff) | |
download | rtems-c468f18bb73a570bf2b3eb279a7dea60b91c3319.tar.bz2 |
add support for LPC32xx
Diffstat (limited to 'c/src/lib/libbsp/arm/lpc32xx/misc')
-rw-r--r-- | c/src/lib/libbsp/arm/lpc32xx/misc/timer.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/arm/lpc32xx/misc/timer.c b/c/src/lib/libbsp/arm/lpc32xx/misc/timer.c new file mode 100644 index 0000000000..5c0246133c --- /dev/null +++ b/c/src/lib/libbsp/arm/lpc32xx/misc/timer.c @@ -0,0 +1,55 @@ +/** + * @file + * + * @ingroup lpc32xx + * + * @brief Benchmark timer support. + */ + +/* + * Copyright (c) 2008, 2009 + * embedded brains GmbH + * Obere Lagerstr. 30 + * D-82178 Puchheim + * Germany + * <rtems@embedded-brains.de> + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ + +#include <rtems.h> +#include <rtems/timerdrv.h> + +static bool benchmark_timer_find_average_overhead = false; + +static uint32_t benchmark_timer_base; + +/* TODO */ +static uint32_t lpc32xx_timer(void) +{ + return 0; +} + +void benchmark_timer_initialize(void) +{ + benchmark_timer_base = lpc32xx_timer(); +} + +uint32_t benchmark_timer_read(void) +{ + uint32_t delta = lpc32xx_timer() - benchmark_timer_base; + + if (benchmark_timer_find_average_overhead) { + return delta; + } else { + /* TODO */ + return 0; + } +} + +void benchmark_timer_disable_subtracting_average_overhead(bool find_average_overhead) +{ + benchmark_timer_find_average_overhead = find_average_overhead; +} |