summaryrefslogtreecommitdiff
path: root/src/stm/ao_sample_profile_timer.h
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-10-23 22:17:49 -0700
committerKeith Packard <keithp@keithp.com>2012-10-25 00:07:14 -0700
commitb119e19604aa557a40e848c60d98a67b5f259bbd (patch)
tree2391c2fb7db1843096ec4e3d288cb26f7cb88b92 /src/stm/ao_sample_profile_timer.h
parent7d34811ba035367bbf26a8510265754f3fbb5a95 (diff)
altos: profiling on STM32L
Add sample-based profiling, using a 1kHz timer Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/stm/ao_sample_profile_timer.h')
-rw-r--r--src/stm/ao_sample_profile_timer.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/stm/ao_sample_profile_timer.h b/src/stm/ao_sample_profile_timer.h
new file mode 100644
index 00000000..1da1bfb4
--- /dev/null
+++ b/src/stm/ao_sample_profile_timer.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright © 2012 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#ifndef _AO_SAMPLE_PROFILE_TIMER_H_
+#define _AO_SAMPLE_PROFILE_TIMER_H_
+
+uint16_t
+ao_sample_profile_timer_start(void);
+
+void
+ao_sample_profile_timer_stop(void);
+
+void
+ao_sample_profile_timer_init(void);
+
+#define ao_sample_profile_timer_value() ((uint16_t) stm_tim11.cnt)
+
+#endif /* _AO_SAMPLE_PROFILE_TIMER_H_ */