Add API to stop HAL SysTick counter.

This commit is contained in:
Jared Boone 2015-08-20 17:51:07 -07:00
parent bd791a8512
commit 5978c99c31
4 changed files with 10 additions and 0 deletions

View File

@ -89,6 +89,10 @@ void systick_adjust_period(const uint32_t counts_per_tick) {
ritimer_start(); ritimer_start();
} }
void systick_stop() {
ritimer_stop();
}
/** /**
* @brief Low level HAL driver initialization. * @brief Low level HAL driver initialization.
* *

View File

@ -145,6 +145,7 @@ typedef uint32_t halrtcnt_t;
extern "C" { extern "C" {
#endif #endif
void hal_lld_init(void); void hal_lld_init(void);
void systick_stop(void);
void systick_adjust_period(const uint32_t counts_per_tick); void systick_adjust_period(const uint32_t counts_per_tick);
halclock_t halLPCGetSystemClock(void); halclock_t halLPCGetSystemClock(void);
void halLPCSetSystemClock(const halclock_t new_frequency); void halLPCSetSystemClock(const halclock_t new_frequency);

View File

@ -63,6 +63,10 @@ void halLPCSetSystemClock(const halclock_t new_frequency) {
hal_clock_f = new_frequency; hal_clock_f = new_frequency;
} }
void systick_stop() {
SysTick->CTRL &= ~(SysTick_CTRL_ENABLE_Msk | SysTick_CTRL_TICKINT_Msk);
}
void systick_adjust_period(const uint32_t counts_per_tick) { void systick_adjust_period(const uint32_t counts_per_tick) {
SysTick->LOAD = counts_per_tick; SysTick->LOAD = counts_per_tick;
} }

View File

@ -164,6 +164,7 @@ typedef uint32_t halrtcnt_t;
extern "C" { extern "C" {
#endif #endif
void hal_lld_init(void); void hal_lld_init(void);
void systick_stop(void);
void systick_adjust_period(const uint32_t counts_per_tick); void systick_adjust_period(const uint32_t counts_per_tick);
halclock_t halLPCGetSystemClock(void); halclock_t halLPCGetSystemClock(void);
void halLPCSetSystemClock(const halclock_t new_frequency); void halLPCSetSystemClock(const halclock_t new_frequency);