[EFM32] Fix bug in rtc_free_real

pull/1340/head
Aksel Skauge Mellbye 2015-09-17 08:23:11 +02:00
parent 8a7ce51ddf
commit e8b022c310
1 changed files with 2 additions and 2 deletions

View File

@ -136,10 +136,10 @@ void rtc_free(void)
void rtc_free_real(uint32_t flags) void rtc_free_real(uint32_t flags)
{ {
/* Clear use flag */ /* Clear use flag */
flags &= ~flags; useflags &= ~flags;
/* Disable the RTC if it was inited and is no longer in use by anyone. */ /* Disable the RTC if it was inited and is no longer in use by anyone. */
if (rtc_inited && (flags == 0)) { if (rtc_inited && (useflags == 0)) {
NVIC_DisableIRQ(RTC_IRQn); NVIC_DisableIRQ(RTC_IRQn);
RTC_Reset(); RTC_Reset();
CMU_ClockEnable(cmuClock_RTC, false); CMU_ClockEnable(cmuClock_RTC, false);