early version of exti_init and rtc_init