Allow setting current timer counter

This commit is contained in:
Scott Lahteine
2017-12-09 19:57:25 -06:00
parent 82ef6b5242
commit 6149b82119
5 changed files with 45 additions and 17 deletions

View File

@ -103,6 +103,13 @@ FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
return 0;
}
FORCE_INLINE static void HAL_timer_set_current_count(const uint8_t timer_num, const hal_timer_t count) {
switch (timer_num) {
case 0: LPC_TIM0->TC = count; break;
case 1: LPC_TIM1->TC = count; break;
}
}
FORCE_INLINE static hal_timer_t HAL_timer_get_current_count(const uint8_t timer_num) {
switch (timer_num) {
case 0: return LPC_TIM0->TC;