From 46265063e3300ab613c03151d7aaade580b10554 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Thu, 21 Aug 2014 08:38:24 -0500 Subject: bsp/tms570: implemented support functions to satisfy complete tests build requirements. This patch enables to build all RTEMS tests for tms570ls3137_hdk_sdram BSP variant in in default build. Debug build with --enable-rtems-debug set has succeed for samples subset of tests as well. --- .../lib/libbsp/arm/tms570/include/system-clocks.h | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 c/src/lib/libbsp/arm/tms570/include/system-clocks.h (limited to 'c/src/lib/libbsp/arm/tms570/include') diff --git a/c/src/lib/libbsp/arm/tms570/include/system-clocks.h b/c/src/lib/libbsp/arm/tms570/include/system-clocks.h new file mode 100644 index 0000000000..d441ec475a --- /dev/null +++ b/c/src/lib/libbsp/arm/tms570/include/system-clocks.h @@ -0,0 +1,62 @@ +/** + * @file benchmark_timer.c + * + * @ingroup tms570 + * + * @brief System clocks. + */ + +/* + * Copyright (c) 2014 Pavel Pisa + * + * Czech Technical University in Prague + * Zikova 1903/4 + * 166 36 Praha 6 + * Czech Republic + * + * Based on LPC24xx and LPC1768 BSP + * by embedded brains GmbH and others + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#ifndef LIBBSP_ARM_TMS570_SYSTEM_CLOCKS_H +#define LIBBSP_ARM_TMS570_SYSTEM_CLOCKS_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @defgroup tms570_clock System Clocks + * + * @ingroup tms570 + * + * @brief System clocks. + * + * @{ + */ + +/** + * @brief Returns current standard timer value in microseconds. + * + * This function uses RTI module free running counter 0 used + * which is used as system tick timebase as well. + */ +static inline unsigned tms570_timer(void) +{ + uint32_t actual_fcr0 = TMS570_RTI.RTIFRC0; + return actual_fcr0; +} + +/** @} */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* LIBBSP_ARM_TMS570_SYSTEM_CLOCKS_H */ -- cgit v1.2.3