maxim: fix rtc if lp ticker not defined

lp ticker handler defined only if lp ticker is defined. In case not,
use only overflow, rtc0 not used.
pull/7009/head
Martin Kojtal 2018-05-25 09:34:14 +01:00 committed by Bartek Szatkowski
parent 9b53c1e9e1
commit 6781ee88cd
1 changed files with 3 additions and 0 deletions

View File

@ -33,6 +33,7 @@
#include "rtc_api.h" #include "rtc_api.h"
#include "lp_ticker_api.h" #include "lp_ticker_api.h"
#include "ticker_api.h"
#include "cmsis.h" #include "cmsis.h"
#include "rtc_regs.h" #include "rtc_regs.h"
#include "pwrseq_regs.h" #include "pwrseq_regs.h"
@ -73,8 +74,10 @@ void rtc_init(void)
MXC_PWRSEQ->reg0 |= MXC_F_PWRSEQ_REG0_PWR_RTCEN_RUN; MXC_PWRSEQ->reg0 |= MXC_F_PWRSEQ_REG0_PWR_RTCEN_RUN;
// Prepare interrupt handlers // Prepare interrupt handlers
#ifdef DEVICE_LPTICKER
NVIC_SetVector(RTC0_IRQn, (uint32_t)lp_ticker_irq_handler); NVIC_SetVector(RTC0_IRQn, (uint32_t)lp_ticker_irq_handler);
NVIC_EnableIRQ(RTC0_IRQn); NVIC_EnableIRQ(RTC0_IRQn);
#endif
NVIC_SetVector(RTC3_IRQn, (uint32_t)overflow_handler); NVIC_SetVector(RTC3_IRQn, (uint32_t)overflow_handler);
NVIC_EnableIRQ(RTC3_IRQn); NVIC_EnableIRQ(RTC3_IRQn);