54
54
#define TIMER_CCER_OFFSET 0x20
55
55
#define TIMER_CNT_OFFSET 0x24
56
56
#define TIMER_PSC_OFFSET 0x28
57
- #define TIMER_APR_OFFSET 0x2c
57
+ #define TIMER_ARR_OFFSET 0x2c
58
58
#define TIMER_RCR_OFFSET 0x30
59
59
#define TIMER_CCR1_OFFSET 0x34
60
60
#define TIMER_CCR2_OFFSET 0x38
@@ -106,7 +106,7 @@ struct Stm32Timer {
106
106
uint32_t ccer ;
107
107
/* uint32_t cnt; Handled by ptimer */
108
108
uint32_t psc ;
109
- uint32_t apr ;
109
+ uint32_t arr ;
110
110
/* uint32_t rcr; Repetition count not supported */
111
111
uint32_t ccr1 ;
112
112
uint32_t ccr2 ;
@@ -137,7 +137,7 @@ static uint32_t stm32_timer_get_count(Stm32Timer *s)
137
137
uint64_t cnt = ptimer_get_count (s -> timer );
138
138
if (s -> countMode == TIMER_UP_COUNT )
139
139
{
140
- return s -> apr - (cnt & 0xfffff );
140
+ return s -> arr - (cnt & 0xfffff );
141
141
}
142
142
else
143
143
{
@@ -149,7 +149,7 @@ static void stm32_timer_set_count(Stm32Timer *s, uint32_t cnt)
149
149
{
150
150
if (s -> countMode == TIMER_UP_COUNT )
151
151
{
152
- ptimer_set_count (s -> timer , s -> apr - (cnt & 0xfffff ));
152
+ ptimer_set_count (s -> timer , s -> arr - (cnt & 0xfffff ));
153
153
}
154
154
else
155
155
{
@@ -207,7 +207,7 @@ static void stm32_timer_tick(void *opaque)
207
207
}
208
208
else
209
209
{
210
- stm32_timer_set_count (s , s -> apr );
210
+ stm32_timer_set_count (s , s -> arr );
211
211
}
212
212
213
213
if (s -> cr1 & 0x0300 ) /* CMS */
@@ -271,9 +271,9 @@ static uint64_t stm32_timer_read(void *opaque, hwaddr offset,
271
271
case TIMER_PSC_OFFSET :
272
272
DPRINTF ("%s psc = %x\n" , stm32_periph_name (s -> periph ), s -> psc );
273
273
return s -> psc ;
274
- case TIMER_APR_OFFSET :
275
- DPRINTF ("%s apr = %x\n" , stm32_periph_name (s -> periph ), s -> apr );
276
- return s -> apr ;
274
+ case TIMER_ARR_OFFSET :
275
+ DPRINTF ("%s arr = %x\n" , stm32_periph_name (s -> periph ), s -> arr );
276
+ return s -> arr ;
277
277
case TIMER_RCR_OFFSET :
278
278
qemu_log_mask (LOG_GUEST_ERROR , "stm32_timer: RCR not supported" );
279
279
return 0 ;
@@ -342,7 +342,7 @@ static void stm32_timer_write(void * opaque, hwaddr offset,
342
342
}
343
343
if (s -> egr & 0x1 ) {
344
344
/* UG bit - reload count */
345
- ptimer_set_limit (s -> timer , s -> apr , 1 );
345
+ ptimer_set_limit (s -> timer , s -> arr , 1 );
346
346
}
347
347
DPRINTF ("%s egr = %x\n" , stm32_periph_name (s -> periph ), s -> egr );
348
348
break ;
@@ -367,10 +367,10 @@ static void stm32_timer_write(void * opaque, hwaddr offset,
367
367
DPRINTF ("%s psc = %x\n" , stm32_periph_name (s -> periph ), s -> psc );
368
368
stm32_timer_freq (s );
369
369
break ;
370
- case TIMER_APR_OFFSET :
371
- s -> apr = value & 0xffff ;
372
- ptimer_set_limit (s -> timer , s -> apr , 1 );
373
- DPRINTF ("%s apr = %x\n" , stm32_periph_name (s -> periph ), s -> apr );
370
+ case TIMER_ARR_OFFSET :
371
+ s -> arr = value & 0xffff ;
372
+ ptimer_set_limit (s -> timer , s -> arr , 1 );
373
+ DPRINTF ("%s arr = %x\n" , stm32_periph_name (s -> periph ), s -> arr );
374
374
break ;
375
375
case TIMER_RCR_OFFSET :
376
376
qemu_log_mask (LOG_GUEST_ERROR , "stm32_timer: RCR not supported" );
@@ -445,7 +445,7 @@ static int stm32_timer_init(SysBusDevice *dev)
445
445
s -> ccmr2 = 0 ;
446
446
s -> ccer = 0 ;
447
447
s -> psc = 0 ;
448
- s -> apr = 0 ;
448
+ s -> arr = 0 ;
449
449
s -> ccr1 = 0 ;
450
450
s -> ccr2 = 0 ;
451
451
s -> ccr3 = 0 ;
0 commit comments