diff options
Diffstat (limited to 'cm3cpp_systick.cpp')
-rw-r--r-- | cm3cpp_systick.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/cm3cpp_systick.cpp b/cm3cpp_systick.cpp index 72ed3e7..3aca667 100644 --- a/cm3cpp_systick.cpp +++ b/cm3cpp_systick.cpp @@ -47,7 +47,7 @@ void CM3CPP_SYSTICK_INT_FUNC(void); #define CM3CPP_SYSTICK_INT_FUNC sys_tick_handler #endif -volatile uint32_t counter; +static volatile uint32_t counter; #if CM3CPP_ENABLE_CUSTOM_SYSTICK_SOURCE != 1 void CM3CPP_SYSTICK_INT_FUNC(void) @@ -96,6 +96,16 @@ void init(uint32_t clock_div) #endif } +void deinit() +{ +#if CM3CPP_ENABLE_CUSTOM_SYSTICK_SOURCE == 1 + timer_disable_counter(CM3CPP_INT_SOURCE); +#else + systick_interrupt_disable(); + systick_counter_disable(); +#endif +} + uint32_t get_counter() { #if CM3CPP_ENABLE_CUSTOM_SYSTICK_SOURCE == 1 |