|
@@ -97,13 +97,13 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
|
97
|
97
|
FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) {
|
98
|
98
|
// Should never be called with timer RTC_TIMER_NUM
|
99
|
99
|
Tc * const tc = TimerConfig[timer_num].pTc;
|
100
|
|
- tc->COUNT32.CC[0].reg = HAL_TIMER_TYPE_MAX - compare;
|
|
100
|
+ tc->COUNT32.CC[0].reg = compare;
|
101
|
101
|
}
|
102
|
102
|
|
103
|
103
|
FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) {
|
104
|
104
|
// Should never be called with timer RTC_TIMER_NUM
|
105
|
105
|
Tc * const tc = TimerConfig[timer_num].pTc;
|
106
|
|
- return (hal_timer_t)(HAL_TIMER_TYPE_MAX - tc->COUNT32.CC[0].reg);
|
|
106
|
+ return (hal_timer_t)tc->COUNT32.CC[0].reg;
|
107
|
107
|
}
|
108
|
108
|
|
109
|
109
|
FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
|
|
@@ -111,7 +111,7 @@ FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
|
111
|
111
|
Tc * const tc = TimerConfig[timer_num].pTc;
|
112
|
112
|
tc->COUNT32.CTRLBSET.reg = TC_CTRLBCLR_CMD_READSYNC;
|
113
|
113
|
SYNC(tc->COUNT32.SYNCBUSY.bit.CTRLB || tc->COUNT32.SYNCBUSY.bit.COUNT);
|
114
|
|
- return HAL_TIMER_TYPE_MAX - tc->COUNT32.COUNT.reg;
|
|
114
|
+ return tc->COUNT32.COUNT.reg;
|
115
|
115
|
}
|
116
|
116
|
|
117
|
117
|
void HAL_timer_enable_interrupt(const uint8_t timer_num);
|