aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple
diff options
context:
space:
mode:
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);