mirror of https://github.com/ARMmbed/mbed-os.git
Polished tickers implementation - moved interrupt clearing code.
parent
bf70d5a4dd
commit
75ba6b7623
|
@ -42,8 +42,7 @@ void lp_ticker_disable_interrupt(void)
|
||||||
|
|
||||||
void lp_ticker_clear_interrupt(void)
|
void lp_ticker_clear_interrupt(void)
|
||||||
{
|
{
|
||||||
// No implementation needed. The event that triggers the interrupt is
|
nrf_rtc_event_clear(COMMON_RTC_INSTANCE, LP_TICKER_EVENT);
|
||||||
// cleared in 'common_rtc_irq_handler'.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // DEVICE_LOWPOWERTIMER
|
#endif // DEVICE_LOWPOWERTIMER
|
||||||
|
|
|
@ -34,32 +34,19 @@ void common_rtc_irq_handler(void)
|
||||||
void COMMON_RTC_IRQ_HANDLER(void)
|
void COMMON_RTC_IRQ_HANDLER(void)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
nrf_rtc_event_t event;
|
if (nrf_rtc_event_pending(COMMON_RTC_INSTANCE, US_TICKER_EVENT)) {
|
||||||
uint32_t int_mask;
|
|
||||||
|
|
||||||
event = US_TICKER_EVENT;
|
|
||||||
int_mask = US_TICKER_INT_MASK;
|
|
||||||
if (nrf_rtc_event_pending(COMMON_RTC_INSTANCE, event)) {
|
|
||||||
nrf_rtc_event_clear(COMMON_RTC_INSTANCE, event);
|
|
||||||
nrf_rtc_event_disable(COMMON_RTC_INSTANCE, int_mask);
|
|
||||||
|
|
||||||
us_ticker_irq_handler();
|
us_ticker_irq_handler();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DEVICE_LOWPOWERTIMER
|
#if DEVICE_LOWPOWERTIMER
|
||||||
event = LP_TICKER_EVENT;
|
if (nrf_rtc_event_pending(COMMON_RTC_INSTANCE, LP_TICKER_EVENT)) {
|
||||||
int_mask = LP_TICKER_INT_MASK;
|
|
||||||
if (nrf_rtc_event_pending(COMMON_RTC_INSTANCE, event)) {
|
|
||||||
nrf_rtc_event_clear(COMMON_RTC_INSTANCE, event);
|
|
||||||
nrf_rtc_event_disable(COMMON_RTC_INSTANCE, int_mask);
|
|
||||||
|
|
||||||
lp_ticker_irq_handler();
|
lp_ticker_irq_handler();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
event = NRF_RTC_EVENT_OVERFLOW;
|
if (nrf_rtc_event_pending(COMMON_RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW)) {
|
||||||
if (nrf_rtc_event_pending(COMMON_RTC_INSTANCE, event)) {
|
nrf_rtc_event_clear(COMMON_RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW);
|
||||||
nrf_rtc_event_clear(COMMON_RTC_INSTANCE, event);
|
|
||||||
// Don't disable this event. It shall occur periodically.
|
// Don't disable this event. It shall occur periodically.
|
||||||
|
|
||||||
++m_common_rtc_overflows;
|
++m_common_rtc_overflows;
|
||||||
|
@ -204,6 +191,5 @@ void us_ticker_disable_interrupt(void)
|
||||||
|
|
||||||
void us_ticker_clear_interrupt(void)
|
void us_ticker_clear_interrupt(void)
|
||||||
{
|
{
|
||||||
// No implementation needed. The event that triggers the interrupt is
|
nrf_rtc_event_clear(COMMON_RTC_INSTANCE, US_TICKER_EVENT);
|
||||||
// cleared in 'common_rtc_irq_handler'.
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue