| | |
| | | void Nvic_Init(void) |
| | | { |
| | | NVIC_InitTypeDef NVIC_InitStructure; |
| | | EXTI_InitTypeDef EXTI_InitStructure; |
| | | |
| | | NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4); |
| | | |
| | | /* Enable and set EXTI Interrupt to the lowest priority */ |
| | |
| | | NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; |
| | | NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; |
| | | |
| | | EXTI_InitStructure.EXTI_Line = EXTI_Line17; |
| | | EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; |
| | | EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising; |
| | | EXTI_InitStructure.EXTI_LineCmd = ENABLE; |
| | | EXTI_Init(&EXTI_InitStructure); |
| | | |
| | | |
| | | NVIC_InitStructure.NVIC_IRQChannel = RTCAlarm_IRQn; |
| | | NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; |
| | |
| | | int Systick_Init(void) |
| | | { |
| | | int time_retry = 500; |
| | | if (SysTick_Config(64000)) |
| | | if (SysTick_Config(72000)) |
| | | { |
| | | /* Capture error */ |
| | | while (time_retry--); |
| | |
| | | { |
| | | uint32_t i=1000*nTimer; |
| | | delay_us(i); |
| | | } |
| | | } |