mirror of https://github.com/ARMmbed/mbed-os.git
SiLabs Pearl: Correct includes and interrupt names in RTC
Conditionals for including em_rtc.h and em_rtcc.h. Use the correct interrupt name in RTCC code.pull/1501/head
parent
21a242049f
commit
c4018e4ea8
|
|
@ -35,6 +35,11 @@
|
|||
#include "rtc_api_HAL.h"
|
||||
#include "lp_ticker_api.h"
|
||||
|
||||
#include "em_int.h"
|
||||
#if (defined RTCC_COUNT) && (RTCC_COUNT > 0)
|
||||
#include "em_rtcc.h"
|
||||
#endif
|
||||
|
||||
static int rtc_reserved = 0;
|
||||
|
||||
void lp_ticker_init()
|
||||
|
|
@ -154,12 +159,12 @@ void lp_ticker_set_interrupt(timestamp_t timestamp)
|
|||
|
||||
/* Set callback */
|
||||
RTCC_ChannelCCVSet(0, (uint32_t)timestamp_ticks);
|
||||
RTCC_IntEnable(RTCC_IF_COMP0);
|
||||
RTCC_IntEnable(RTCC_IF_CC0);
|
||||
}
|
||||
|
||||
inline void lp_ticker_disable_interrupt()
|
||||
{
|
||||
RTCC_IntDisable(RTCC_IF_COMP0);
|
||||
RTCC_IntDisable(RTCC_IF_CC0);
|
||||
|
||||
INT_Disable();
|
||||
if(rtc_reserved) {
|
||||
|
|
@ -171,7 +176,7 @@ inline void lp_ticker_disable_interrupt()
|
|||
|
||||
inline void lp_ticker_clear_interrupt()
|
||||
{
|
||||
RTCC_IntClear(RTCC_IF_COMP0);
|
||||
RTCC_IntClear(RTCC_IF_CC0);
|
||||
}
|
||||
|
||||
timestamp_t lp_ticker_read()
|
||||
|
|
|
|||
|
|
@ -34,10 +34,17 @@
|
|||
#include "rtc_api.h"
|
||||
#include "rtc_api_HAL.h"
|
||||
#include "em_cmu.h"
|
||||
#include "em_rtc.h"
|
||||
#include "sleep_api.h"
|
||||
#include "sleepmodes.h"
|
||||
|
||||
#if (defined RTC_COUNT) && (RTC_COUNT > 0)
|
||||
#include "em_rtc.h"
|
||||
#endif
|
||||
|
||||
#if (defined RTCC_COUNT) && (RTCC_COUNT > 0)
|
||||
#include "em_rtcc.h"
|
||||
#endif
|
||||
|
||||
static bool rtc_inited = false;
|
||||
static time_t time_base = 0;
|
||||
static uint32_t useflags = 0;
|
||||
|
|
@ -153,8 +160,8 @@ void RTCC_IRQHandler(void)
|
|||
time_extend += 1;
|
||||
}
|
||||
|
||||
if (flags & RTCC_IF_COMP0) {
|
||||
RTCC_IntClear(RTCC_IF_COMP0);
|
||||
if (flags & RTCC_IF_CC0) {
|
||||
RTCC_IntClear(RTCC_IF_CC0);
|
||||
if (comp0_handler != NULL) {
|
||||
comp0_handler();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue