diff --git a/arch/avr/src/at32uc3/at32uc3_timerisr.c b/arch/avr/src/at32uc3/at32uc3_timerisr.c index d876e1067caf49c623cac5518bfa94f64ea713b1..655b312e7ddc85b648696390d46c4e9fba3f1a47 100644 --- a/arch/avr/src/at32uc3/at32uc3_timerisr.c +++ b/arch/avr/src/at32uc3/at32uc3_timerisr.c @@ -203,7 +203,7 @@ void up_timerinit(void) putreg32(regval, AVR32_PM_PBAMASK); #endif - /* Configure the RTC. Source == 32KHz OSC32 */ + /* Configure the RTC. Source == 32KHz OSC32 or RC OSC */ rtc_waitnotbusy(); #ifdef AVR32_CLOCK_OSC32 @@ -217,8 +217,9 @@ void up_timerinit(void) /* Set the counter value to zero and the TOP value to AVR32_TOP (see above) */ rtc_waitnotbusy(); - putreg32(0, AVR32_RTC_VAL); putreg32(AV32_TOP, AVR32_RTC_TOP); + rtc_waitnotbusy(); + putreg32(0, AVR32_RTC_VAL); /* Attach the timer interrupt vector */