Hi,
in SDK/components/libraries/timer/drv_rtc.h, there is some preprocessor define provided to select the RTC module (0, 1 or 2) used by app_timer2: APP_TIMER_V2_RTC0_ENABLED, APP_TIMER_V2_RTC1_ENABLED, APP_TIMER_V2_RTC2_ENABLE.
But in app_timer2.c, the RTC instance is fixed:
static drv_rtc_t m_rtc_inst = DRV_RTC_INSTANCE(1);
Can you change it to allow the other RTC instance to be used, like this:
#if defined(APP_TIMER_V2_RTC0_ENABLED) static drv_rtc_t m_rtc_inst = DRV_RTC_INSTANCE(0); #elif defined(APP_TIMER_V2_RTC1_ENABLED) static drv_rtc_t m_rtc_inst = DRV_RTC_INSTANCE(1); #elif defined(APP_TIMER_V2_RTC2_ENABLED) static drv_rtc_t m_rtc_inst = DRV_RTC_INSTANCE(2); #endif
Thank you !
Best,
jym