Programo STM32F4 usando Interrupción Externa, y hay un error a continuación:
Error[Li005]:nohaydefiniciónpara"SYSCFG_EXTILineConfig" referenciado en C: \ Users \ AnhDoan \ Desktop \ STM32 \ IAR [GPIO LED_Blink_Freq_Button \ Debug \ Obj \ main.o]
Error al ejecutar el enlazador.
Código:
> /* Traffic Light: LED13 for 10s, then LED14 for 5s, then LED15 for 10s Press the button: switch to the next LED immediately (order:
> LED13->14, LED14->LED14, LED15->LED13) Avoid pressing too fast
> */
>
> #include "stm32f4xx.h"
>
>
> GPIO_InitTypeDef GPIO_InitStructure; TIM_TimeBaseInitTypeDef
> TIM_BaseStruct; EXTI_InitTypeDef EXTI_InitStructure; NVIC_InitTypeDef
> NVIC_InitStructure;
>
> void GPIO_Configuration(void); void TIM_Configuration(void); void
> EXTI_Configuration(void);
>
> int main(void) { GPIO_Configuration(); EXTI_Configuration();
> TIM_Configuration(); while(1) { } }
>
>
> void GPIO_Configuration(void) {
> RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);
> GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15;
> GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
> GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
> GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
> GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOD,
> &GPIO_InitStructure); }
>
> void EXTI_Configuration() {
> RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);
> RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
> GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
> GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
> GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
> GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
> GPIO_Init(GPIOA,&GPIO_InitStructure);
> SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOA, EXTI_PinSource0);
> EXTI_InitStructure.EXTI_Line = EXTI_Line0; EXTI_InitStructure.EXTI_LineCmd = ENABLE;
> EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
> EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising;
> EXTI_Init(&EXTI_InitStructure);
> //Add Interrupt (IRQ) to NVIC NVIC_InitStructure.NVIC_IRQChannel = EXTI0_IRQn;
> NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
> NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
> NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
> NVIC_Init(&NVIC_InitStructure); }
>
> void TIM_Configuration(void) {
> RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2,ENABLE);
> TIM_BaseStruct.TIM_Prescaler = 21000-1; //0.5s TIM_BaseStruct.TIM_CounterMode = TIM_CounterMode_Up;
> TIM_BaseStruct.TIM_Period = 2000-1; TIM_BaseStruct.TIM_ClockDivision
> = 0; TIM_BaseStruct.TIM_RepetitionCounter = 0;
> TIM_TimeBaseInit(TIM2,&TIM_BaseStruct);
> TIM_Cmd(TIM2,ENABLE);
> NVIC_InitStructure.NVIC_IRQChannel = TIM2_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x01;
> NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x00;
> NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
> NVIC_Init(&NVIC_InitStructure); }
>
>
>
> #ifdef USE_FULL_ASSERT void assert_failed(uint8_t* file, uint32_t line) { /* User can add his own implementation to report the file
> name and line number,
> ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
>
> /* Infinite loop */ while (1) { } }
> #endif
¿Puede decirme cuál es el problema y cómo solucionarlo (en detalle), por favor? Lo verifiqué pero no encuentro ningún error en el código.
Muchas gracias.