Skip to content

Commit 00a769f

Browse files
committed
Not sure why we need the 2x but it reflects what the hardware does
1 parent 846417e commit 00a769f

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
@@ -120,10 +120,10 @@ typedef struct {
120120

121121
static void stm32_timer_freq(Stm32Timer *s)
122122
{
123-
uint32_t clk_freq = stm32_rcc_get_periph_freq(s->stm32_rcc, s->periph) / (s->psc + 1);
123+
uint32_t clk_freq = 2*stm32_rcc_get_periph_freq(s->stm32_rcc, s->periph) / (s->psc + 1);
124124
DPRINTF
125125
(
126-
"%s Update freq = %d / %d = %d\n",
126+
"%s Update freq = 2 * %d / %d = %d\n",
127127
stm32_periph_name(s->periph),
128128
stm32_rcc_get_periph_freq(s->stm32_rcc, s->periph),
129129
(s->psc + 1),

0 commit comments

Comments
 (0)