summaryrefslogtreecommitdiff
path: root/c/src/lib/libbsp/arm/lpc176x/benchmark_timer/benchmark_timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libbsp/arm/lpc176x/benchmark_timer/benchmark_timer.c')
-rw-r--r--c/src/lib/libbsp/arm/lpc176x/benchmark_timer/benchmark_timer.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/arm/lpc176x/benchmark_timer/benchmark_timer.c b/c/src/lib/libbsp/arm/lpc176x/benchmark_timer/benchmark_timer.c
new file mode 100644
index 0000000000..a8f2855660
--- /dev/null
+++ b/c/src/lib/libbsp/arm/lpc176x/benchmark_timer/benchmark_timer.c
@@ -0,0 +1,45 @@
+/**
+ * @file timerbenchmark.c
+ *
+ * @ingroup lpc176x
+ *
+ * @brief Timer benchmark functions for the lpc176x bsp.
+ */
+
+/*
+ * Copyright (c) 2014 Taller Technologies.
+ *
+ * @author Boretto Martin (martin.boretto@tallertechnologies.com)
+ * @author Diaz Marcos (marcos.diaz@tallertechnologies.com)
+ * @author Lenarduzzi Federico (federico.lenarduzzi@tallertechnologies.com)
+ * @author Daniel Chicco (daniel.chicco@tallertechnologies.com)
+ *
+ * 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 <bsp.h>
+#include <rtems/btimer.h>
+
+#include <bsp/timer.h>
+
+static uint32_t benchmark_timer_base;
+
+void benchmark_timer_initialize( void )
+{
+ benchmark_timer_base = lpc176x_timer_get_timer_value( LPC176X_TIMER_1 );
+}
+
+uint32_t benchmark_timer_read( void )
+{
+ uint32_t delta = lpc176x_timer_get_timer_value( LPC176X_TIMER_1 ) -
+ benchmark_timer_base;
+
+ return delta;
+}
+
+void benchmark_timer_disable_subtracting_average_overhead( bool find_avg_ovhead )
+{
+} \ No newline at end of file