mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-28 16:01:18 +01:00
Merge pull request #3623 from gebart/pr/kinetis-timer-stop-fix
cpu/kinetis_common: periph/timer, read PIT value before stopping
This commit is contained in:
commit
808b1abdd0
@ -149,8 +149,8 @@ int timer_set_absolute(tim_t dev, int channel, unsigned int value)
|
||||
#if TIMER_0_EN
|
||||
|
||||
case TIMER_0:
|
||||
pit_timer_stop(TIMER_0_COUNTER_CH);
|
||||
cu_timer[dev].counter32b = pit_timer_read(dev, TIMER_0_COUNTER_CH);
|
||||
pit_timer_stop(TIMER_0_COUNTER_CH);
|
||||
cu_timer[dev].diff = value - cu_timer[dev].counter32b;
|
||||
TIMER_BASE->CHANNEL[TIMER_0_COUNTER_CH].LDVAL = cu_timer[dev].diff;
|
||||
pit_timer_start(TIMER_0_COUNTER_CH);
|
||||
@ -159,8 +159,8 @@ int timer_set_absolute(tim_t dev, int channel, unsigned int value)
|
||||
#if TIMER_1_EN
|
||||
|
||||
case TIMER_1:
|
||||
pit_timer_stop(TIMER_1_COUNTER_CH);
|
||||
cu_timer[dev].counter32b = pit_timer_read(dev, TIMER_1_COUNTER_CH);
|
||||
pit_timer_stop(TIMER_1_COUNTER_CH);
|
||||
cu_timer[dev].diff = value - cu_timer[dev].counter32b;
|
||||
TIMER_BASE->CHANNEL[TIMER_1_COUNTER_CH].LDVAL = cu_timer[dev].diff;
|
||||
pit_timer_start(TIMER_1_COUNTER_CH);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user