Skip to content

Commit d5e92d3

Browse files
committed
Fix bug - Timer EGR register was using wrong value
1 parent 9659601 commit d5e92d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hw/timer/stm32_timer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,11 @@ static void stm32_timer_write(void * opaque, hwaddr offset,
343343
break;
344344
case TIMER_EGR_OFFSET:
345345
s->egr = value & 0x1E;
346-
if (s->egr & 0x40) {
346+
if (value & 0x40) {
347347
/* TG bit */
348348
s->sr |= 0x40;
349349
}
350-
if (s->egr & 0x1) {
350+
if (value & 0x1) {
351351
/* UG bit - reload count */
352352
ptimer_set_limit(s->timer, s->arr, 1);
353353
}

0 commit comments

Comments
 (0)