1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/atmega_common: timer: implement TIM_FLAG_SET_STOPPED

This commit is contained in:
Benjamin Valentin 2022-03-01 14:00:13 +01:00
parent c5a78bd32f
commit 4540e490e3

View File

@ -224,7 +224,12 @@ int timer_set_periodic(tim_t tim, int channel, unsigned int value, uint8_t flags
/* disable CTC mode */
ctx[tim].mode &= (1 << 3);
}
ctx[tim].dev->CRB = ctx[tim].mode;
/* enable timer or stop it */
if (flags & TIM_FLAG_SET_STOPPED) {
ctx[tim].dev->CRB = 0;
} else {
ctx[tim].dev->CRB = ctx[tim].mode;
}
} else {
assert((flags & TIM_FLAG_RESET_ON_MATCH) == 0);
res = -1;