Skip to content

Commit 6781ee8

Browse files
0xc0170bulislaw
authored andcommitted
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.
1 parent 9b53c1e commit 6781ee8

File tree

1 file changed

+3
-0
lines changed
  • targets/TARGET_Maxim/TARGET_MAX32600

1 file changed

+3
-0
lines changed

targets/TARGET_Maxim/TARGET_MAX32600/rtc_api.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
#include "rtc_api.h"
3535
#include "lp_ticker_api.h"
36+
#include "ticker_api.h"
3637
#include "cmsis.h"
3738
#include "rtc_regs.h"
3839
#include "pwrseq_regs.h"
@@ -73,8 +74,10 @@ void rtc_init(void)
7374
MXC_PWRSEQ->reg0 |= MXC_F_PWRSEQ_REG0_PWR_RTCEN_RUN;
7475

7576
// Prepare interrupt handlers
77+
#ifdef DEVICE_LPTICKER
7678
NVIC_SetVector(RTC0_IRQn, (uint32_t)lp_ticker_irq_handler);
7779
NVIC_EnableIRQ(RTC0_IRQn);
80+
#endif
7881
NVIC_SetVector(RTC3_IRQn, (uint32_t)overflow_handler);
7982
NVIC_EnableIRQ(RTC3_IRQn);
8083

0 commit comments

Comments
 (0)