aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2010-09-05 23:48:31 -0400
committerbnewbold <bnewbold@robocracy.org>2010-09-05 23:48:31 -0400
commit5bfeb40e4795eb5cf21ea84311936acf97969365 (patch)
tree3c7a9e42e7a756a9258c97a63462bda0bf343bbe /libmaple
parent552da8705245a876c2e816bab93edc2cb39f94e3 (diff)
downloadlibrambutan-5bfeb40e4795eb5cf21ea84311936acf97969365.tar.gz
librambutan-5bfeb40e4795eb5cf21ea84311936acf97969365.zip
systick testing and simplification
ripped out marti's SystemTick for the sake of simplicity and added a systick_resume function to libmaple. new example program demonstrates the functionality, also demonstrates micros()/USB bug
Diffstat (limited to 'libmaple')
-rw-r--r--libmaple/systick.c7
-rw-r--r--libmaple/systick.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/libmaple/systick.c b/libmaple/systick.c
index 456ac2f..9fbb152 100644
--- a/libmaple/systick.c
+++ b/libmaple/systick.c
@@ -58,6 +58,13 @@ void systick_disable() {
__write(SYSTICK_CSR, SYSTICK_SRC_HCLK);
}
+void systick_resume() {
+ /* re-enable init registers without changing relead_val */
+ __write(SYSTICK_CSR, SYSTICK_SRC_HCLK |
+ SYSTICK_ENABLE |
+ SYSTICK_TICKINT);
+}
+
void SysTickHandler(void) {
systick_timer_millis++;
}
diff --git a/libmaple/systick.h b/libmaple/systick.h
index 86284f8..80e2fde 100644
--- a/libmaple/systick.h
+++ b/libmaple/systick.h
@@ -44,6 +44,7 @@ extern "C"{
void systick_init(uint32 reload_val);
void systick_disable();
+void systick_resume();
static inline uint32 systick_get_count(void) {
return __read(SYSTICK_CNT);