diff options
author | Marti Bolivar <mbolivar@mit.edu> | 2010-08-31 18:28:07 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@mit.edu> | 2010-08-31 18:28:07 -0400 |
commit | 9c9d6c153154981fdedbe3f9ed4a1fb61e2b7776 (patch) | |
tree | 09d442ef012b8578a52cffb352af52eabf640301 /libmaple | |
parent | 1e3e0862bbe9aefe25663124c1f2e1f8a20e1358 (diff) | |
download | librambutan-9c9d6c153154981fdedbe3f9ed4a1fb61e2b7776.tar.gz librambutan-9c9d6c153154981fdedbe3f9ed4a1fb61e2b7776.zip |
added support to enable/disable systick in wirish
Diffstat (limited to 'libmaple')
-rw-r--r-- | libmaple/systick.c | 6 | ||||
-rw-r--r-- | libmaple/systick.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/libmaple/systick.c b/libmaple/systick.c index 8b0d92a..456ac2f 100644 --- a/libmaple/systick.c +++ b/libmaple/systick.c @@ -52,6 +52,12 @@ void systick_init(uint32 reload_val) { SYSTICK_TICKINT); } +void systick_disable() { + /* clock the system timer with the core clock, but don't turn it on + or enable interrupt. */ + __write(SYSTICK_CSR, SYSTICK_SRC_HCLK); +} + void SysTickHandler(void) { systick_timer_millis++; } diff --git a/libmaple/systick.h b/libmaple/systick.h index 57b724a..86284f8 100644 --- a/libmaple/systick.h +++ b/libmaple/systick.h @@ -43,6 +43,7 @@ extern "C"{ #endif void systick_init(uint32 reload_val); +void systick_disable(); static inline uint32 systick_get_count(void) { return __read(SYSTICK_CNT); |